Skip to content

Commit

Permalink
fix zoom via keys/outside of widget
Browse files Browse the repository at this point in the history
  • Loading branch information
ToCraft committed Oct 30, 2024
1 parent aca2797 commit 96865e0
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,9 @@ private void zoom(double fac, double relX, double relY) {
if (zoom != oZoom) {
double newZ = zoom / oZoom;

if (isHovered) {
// Apply zoom, and adjust the texture offset to ensure zoom focuses on the mouse cursor
textureOffsetX = (textureOffsetX + relX) * newZ - relX;
textureOffsetY = (textureOffsetY + relY) * newZ - relY;
}
// Apply zoom, and adjust the texture offset to ensure zoom focuses on the mouse cursor
textureOffsetX = (textureOffsetX + relX) * newZ - relX;
textureOffsetY = (textureOffsetY + relY) * newZ - relY;

updateZoomedHeight();
updateZoomedWidth();
Expand Down

0 comments on commit 96865e0

Please sign in to comment.