summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-09-25 06:02:31 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-09-26 11:22:50 +0200
commitba5603ada3d2314e0e75838763c2ac9f583fc3dc (patch)
tree5d44313d697022e935389473269eafed95093f23 /tracker-pt
parent6c6a12df66cb0afd56630f9676f81e9d6c205a0f (diff)
tracker/pt: fix preview size on win32 hidpi
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 9abe41ba..255330c4 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -13,6 +13,7 @@
#include "compat/math-imports.hpp"
#include "compat/check-visible.hpp"
#include "compat/thread-name.hpp"
+#include "compat/qt-dpi.hpp"
#include <QHBoxLayout>
#include <QDebug>
@@ -29,7 +30,7 @@ Tracker_PT::Tracker_PT(pointer<pt_runtime_traits> const& traits) :
point_extractor { traits->make_point_extractor() },
camera { traits->make_camera() },
frame { traits->make_frame() },
- preview_frame { traits->make_preview(preview_width, preview_height) }
+ preview_frame {}
{
opencv_init();
@@ -145,6 +146,10 @@ module_status Tracker_PT::start_tracker(QFrame* video_frame)
video_frame->setLayout(layout.get());
//video_widget->resize(video_frame->width(), video_frame->height());
video_frame->show();
+ double dpi = screen_dpi(video_frame);
+
+ preview_frame = traits->make_preview(iround(preview_width * dpi),
+ iround(preview_height * dpi));
start(QThread::HighPriority);