Skip to content

Commit

Permalink
Removed incorrect rounding calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Sep 17, 2024
1 parent c6d649f commit 05c8033
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
13 changes: 2 additions & 11 deletions src/lib/mrvFl/mrvSaveImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ namespace mrv
Fl::check();

const auto& viewportSize = view->getViewportSize();
math::Size2i outputSize;
if (viewportSize.w >= renderSize.w &&
viewportSize.h >= renderSize.h)
{
Expand All @@ -222,17 +221,9 @@ namespace mrv
"Will scale to the viewport size."));

view->frameView();

double zoom =
viewportSize.h / static_cast<double>(renderSize.h);

if (zoom * renderSize.w > viewportSize.w)
{
zoom = viewportSize.w / static_cast<double>(renderSize.w);
}

outputInfo.size.w = std::round(renderSize.w * zoom);
outputInfo.size.h = std::round(renderSize.h * zoom);
outputInfo.size.w = viewportSize.w;
outputInfo.size.h = viewportSize.h;
}

X = (viewportSize.w - outputInfo.size.w) / 2;
Expand Down
12 changes: 2 additions & 10 deletions src/lib/mrvFl/mrvSaveMovie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,17 +462,9 @@ namespace mrv
"Will scale to the viewport size."));

view->frameView();

double zoom =
viewportSize.h / static_cast<double>(renderSize.h);

if (zoom * renderSize.w > viewportSize.w)
{
zoom = viewportSize.w / static_cast<double>(renderSize.w);
}

outputInfo.size.w = std::round(renderSize.w * zoom);
outputInfo.size.h = std::round(renderSize.h * zoom);
outputInfo.size.w = viewportSize.w;
outputInfo.size.h = viewportSize.h;
}

X = (viewportSize.w - outputInfo.size.w) / 2;
Expand Down

0 comments on commit 05c8033

Please sign in to comment.