From 312118bfce391c42f8360a63b2e939e79e38408e Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Fri, 15 Mar 2024 19:01:46 -0400 Subject: [PATCH] [scene2d.ui] Fixed ScrollPane#scrollTo setting scrollX when there's a width. --- gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java b/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java index 2831d146848..b268ff70aef 100644 --- a/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java +++ b/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java @@ -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;