Skip to content

Commit

Permalink
fix argument order of Math.clamp() calls in PinBoardSkin
Browse files Browse the repository at this point in the history
  • Loading branch information
xzel23 committed Feb 16, 2025
1 parent 490d9ca commit 7106428
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ public void scrollTo(double x, double y, double relativeXinVP, double relativeYi

Bounds viewportBounds = scrollPane.getViewportBounds();

double tx = Math.clamp(0.0, 1.0, relativeXinVP) * viewportBounds.getWidth();
double ty = Math.clamp(0.0, 1.0, relativeYinVP) * viewportBounds.getHeight();
double tx = Math.clamp(relativeXinVP, 0.0, 1.0) * viewportBounds.getWidth();
double ty = Math.clamp(relativeYinVP, 0.0, 1.0) * viewportBounds.getHeight();
double sx = calcScrollPosition(x - tx, boardArea.getMinX(), boardArea.getMaxX(), viewportBounds.getWidth());
double sy = calcScrollPosition(y - ty, boardArea.getMinY(), boardArea.getMaxY(), viewportBounds.getHeight());

Expand Down

0 comments on commit 7106428

Please sign in to comment.