From: NathanSweet Date: Fri, 24 May 2013 11:39:22 +0000 (+0200) Subject: Added updateVisualScroll for setting scroll position without animating. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9def89f7003f55b4c3807de130da4a3a0abb6f62;p=mikumikustudio%2Flibgdx-mikumikustudio.git Added updateVisualScroll for setting scroll position without animating. --- 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 c8e781d52..5ed2824d3 100644 --- a/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java +++ b/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java @@ -657,6 +657,12 @@ public class ScrollPane extends WidgetGroup { return amountY; } + /** Sets the visual scroll amount equal to the scroll amount. This can be used when setting the scroll amount without animating. */ + public void updateVisualScroll () { + visualAmountX = amountX; + visualAmountY = amountY; + } + public float getVisualScrollX () { return !scrollX ? 0 : visualAmountX; }