Fix Tracker object label size on high res

This commit is contained in:
manongjohn 2022-03-30 19:21:39 -04:00
parent b6c4c04934
commit dfd4dab05d

View file

@ -8,6 +8,7 @@
#include "toonz/txshlevelhandle.h" #include "toonz/txshlevelhandle.h"
#include "toonz/tscenehandle.h" #include "toonz/tscenehandle.h"
#include "toonzqt/selectioncommandids.h" #include "toonzqt/selectioncommandids.h"
#include "toonzqt/gutil.h"
#include "toonzqt/selection.h" #include "toonzqt/selection.h"
#include "tproperty.h" #include "tproperty.h"
@ -287,6 +288,7 @@ void TrackerTool::draw() {
selectedObjectId = -1; selectedObjectId = -1;
int i = 0; int i = 0;
double pixelSize = getPixelSize(); double pixelSize = getPixelSize();
int devPixRatio = getDevicePixelRatio(m_viewer->viewerWidget());
std::vector<TRectD> balloons; // this is used to avoid balloons overlapping std::vector<TRectD> balloons; // this is used to avoid balloons overlapping
// draw hooks // draw hooks
@ -324,7 +326,7 @@ void TrackerTool::draw() {
tglColor(textColor); tglColor(textColor);
glPushMatrix(); glPushMatrix();
glTranslated(hook->getPos(fid).x, hook->getPos(fid).y, 0); glTranslated(hook->getPos(fid).x, hook->getPos(fid).y, 0);
glScaled(pixelSize, pixelSize, 1); glScaled(pixelSize * devPixRatio, pixelSize * devPixRatio, 1);
int objectId = hook->getTrackerObjectId(); int objectId = hook->getTrackerObjectId();
std::string text({static_cast<char>('A' + objectId)}); std::string text({static_cast<char>('A' + objectId)});
tglDrawText(TPointD(-15, 10), text); tglDrawText(TPointD(-15, 10), text);