Skip to content

Commit

Permalink
reworked some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thrust26 committed Aug 31, 2023
1 parent fefec18 commit 065c024
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/gui/RomImageWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(_w) / mySrcRect.w(),
static_cast<float>(myImageHeight) / mySrcRect.h()) * scaleDpi;
Expand All @@ -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()
Expand All @@ -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<float>(lw) / iw,
static_cast<float>(lh) / ih));
const Int32 w = iw * zoom;
Expand Down
10 changes: 5 additions & 5 deletions src/gui/RomImageWidget.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -91,12 +91,12 @@ class RomImageWidget : public Widget
// Surface pointer holding the navigation elements
shared_ptr<FBSurface> myNavSurface;

// Whether the surface should be redrawn by drawWidget()
bool mySurfaceIsValid{false};

// Surface pointer holding the frame around the zoomed image
shared_ptr<FBSurface> myFrameSurface;

// Whether the surface should be redrawn by drawWidget()
bool mySurfaceIsValid{false};

// Rectangle holdering the original surface size
Common::Rect mySrcRect;

Expand Down

0 comments on commit 065c024

Please sign in to comment.