Skip to content

Commit

Permalink
[scene2d.ui] Fixed ScrollPane#scrollTo setting scrollX when there's a…
Browse files Browse the repository at this point in the history
… width.
  • Loading branch information
NathanSweet committed Mar 15, 2024
1 parent 5ddcc7a commit 312118b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ public void scrollTo (float x, float y, float width, float height, boolean cente
if (centerHorizontal)
amountX = x + (width - actorArea.width) / 2;
else
amountX = MathUtils.clamp(amountX, x + width - actorArea.width, x);
amountX = MathUtils.clamp(amountX, x, x + width - actorArea.width);
scrollX(MathUtils.clamp(amountX, 0, maxX));

float amountY = this.amountY;
Expand Down

0 comments on commit 312118b

Please sign in to comment.