diff --git a/src/gui/RomImageWidget.cxx b/src/gui/RomImageWidget.cxx index edeb4ab8a..cc8bd9626 100644 --- a/src/gui/RomImageWidget.cxx +++ b/src/gui/RomImageWidget.cxx @@ -361,7 +361,7 @@ void RomImageWidget::zoomSurface(bool zoomed, bool force) if(!zoomed) { - // Scale surface to available image area + // Scale surface to available widget area const float scale = std::min( static_cast(_w) / mySrcRect.w(), static_cast(myImageHeight) / mySrcRect.h()) * scaleDpi; @@ -372,8 +372,8 @@ void RomImageWidget::zoomSurface(bool zoomed, bool force) } else { - // display zoomed image centered over mouse position, considering launcher borders - myZoomPos = myMousePos; + // Scale surface to available launcher area + myZoomPos = myMousePos; // remember initial zoom position const Int32 b = 3 * scaleDpi; const Common::Size maxSize = instance().frameBuffer().fullScreen() @@ -383,7 +383,7 @@ void RomImageWidget::zoomSurface(bool zoomed, bool force) const Int32 lh = maxSize.h - b * 2; const Int32 iw = mySrcRect.w() * scaleDpi; const Int32 ih = mySrcRect.h() * scaleDpi; - const float zoom = std::min(1.F, + const float zoom = std::min(1.F, // do not zoom beyond original size std::min(static_cast(lw) / iw, static_cast(lh) / ih)); const Int32 w = iw * zoom; diff --git a/src/gui/RomImageWidget.hxx b/src/gui/RomImageWidget.hxx index f95f53af6..36a5bcee8 100644 --- a/src/gui/RomImageWidget.hxx +++ b/src/gui/RomImageWidget.hxx @@ -81,8 +81,8 @@ class RomImageWidget : public Widget // Zoom delay [frames] static constexpr uInt32 DELAY_TIME = 45; - // The zoom is faster requested than released, so that repeated zooms are - // shown faster. This constant defines how much faster. + // The zoom is faster requested than released, so that repeated zooms + // are shown faster. This constant defines how much faster. static constexpr uInt32 REQUEST_SPEED = 2; // Surface pointer holding the image @@ -91,12 +91,12 @@ class RomImageWidget : public Widget // Surface pointer holding the navigation elements shared_ptr myNavSurface; - // Whether the surface should be redrawn by drawWidget() - bool mySurfaceIsValid{false}; - // Surface pointer holding the frame around the zoomed image shared_ptr myFrameSurface; + // Whether the surface should be redrawn by drawWidget() + bool mySurfaceIsValid{false}; + // Rectangle holdering the original surface size Common::Rect mySrcRect;