From 1bf24773344039a2460598afe68b9843769d1473 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 18 Mar 2019 17:40:10 +0100 Subject: tracker/pt: only update preview when visible --- tracker-pt/ftnoir_tracker_pt.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tracker-pt/ftnoir_tracker_pt.cpp') 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) { -- cgit v1.2.3