From f1aef66f50afcd0fa2f0886b60977311e59334cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 27 Apr 2023 15:56:45 -0300 Subject: [PATCH] Fixed saving with annotations on big images not centering them properly. --- mrv2/lib/mrvFl/mrvSaving.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mrv2/lib/mrvFl/mrvSaving.cpp b/mrv2/lib/mrvFl/mrvSaving.cpp index b29caf824..12ed44300 100644 --- a/mrv2/lib/mrvFl/mrvSaving.cpp +++ b/mrv2/lib/mrvFl/mrvSaving.cpp @@ -116,17 +116,23 @@ namespace mrv if (annotations) { view->setPresentationMode(true); + view->redraw(); + // flush is needed + Fl::flush(); Fl::check(); const auto& viewportSize = view->getViewportSize(); if (viewportSize.w >= renderSize.w && viewportSize.h >= renderSize.h) { - X = (viewportSize.w - renderSize.w) / 2; - Y = (viewportSize.h - renderSize.h) / 2; - view->setFrameView(false); view->setViewZoom(1.0); view->centerView(); + view->redraw(); + // flush is needed + Fl::flush(); + + X = (viewportSize.w - renderSize.w) / 2; + Y = (viewportSize.h - renderSize.h) / 2; } else { @@ -290,6 +296,7 @@ namespace mrv c->uiTimeline->setTimelinePlayer(player); player->seek(currentTime); + view->setFrameView(ui->uiPrefs->uiPrefsAutoFitImage->value()); view->setHudActive(hud); view->setPresentationMode(presentation); tcp->unlock();