mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 13:21:34 +00:00
Fix zooming w/tiled mode (fix #2120)
Regression introduced in d0962eb737ab0f652952982db7b0d68596b80545 Bug reported in: * https://github.com/aseprite/aseprite/issues/2120 * https://community.aseprite.org/t/less-jank-in-tile-view/3659
This commit is contained in:
parent
a70a3a11c7
commit
b55d407ac1
@ -2279,8 +2279,11 @@ void Editor::setZoomAndCenterInMouse(const Zoom& zoom,
|
||||
break;
|
||||
}
|
||||
|
||||
// Limit zooming screen position to the visible sprite bounds
|
||||
gfx::Rect visibleBounds = editorToScreen(getVisibleSpriteBounds());
|
||||
// Limit zooming screen position to the visible sprite bounds (we
|
||||
// use canvasSize() because if the tiled mode is enabled, we need
|
||||
// extra space for the zoom)
|
||||
gfx::Rect visibleBounds = editorToScreen(
|
||||
getViewportBounds().createIntersection(gfx::Rect(gfx::Point(0, 0), canvasSize())));
|
||||
screenPos.x = base::clamp(screenPos.x, visibleBounds.x, visibleBounds.x2()-1);
|
||||
screenPos.y = base::clamp(screenPos.y, visibleBounds.y, visibleBounds.y2()-1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user