Skip to content

Commit

Permalink
Fixed saving with annotations on big images not centering them properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Apr 27, 2023
1 parent 697329e commit f1aef66
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mrv2/lib/mrvFl/mrvSaving.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f1aef66

Please sign in to comment.