summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-03-18 17:40:10 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-03-18 17:40:10 +0100
commit1bf24773344039a2460598afe68b9843769d1473 (patch)
treeda3d2df213cbf8e5d485aca2547838c698c7bf16 /tracker-pt
parentc7cf7066d7734650286242b3ab074258345219e0 (diff)
tracker/pt: only update preview when visible
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 4b796af7..817629e5 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -9,6 +9,7 @@
#include "ftnoir_tracker_pt.h"
#include "video/video-widget.hpp"
#include "compat/math-imports.hpp"
+#include "compat/check-visible.hpp"
#include "pt-api.hpp"
@@ -102,9 +103,11 @@ void Tracker_PT::run()
if (p[2] > f(.1))
preview_frame->draw_head_center((p[0] * fx) / p[2], (p[1] * fx) / p[2]);
- widget->update_image(preview_frame->get_bitmap());
+ if (check_is_visible())
{
+ widget->update_image(preview_frame->get_bitmap());
+
auto [ w, h ] = widget->preview_size();
if (w != preview_width || h != preview_height)
{