OSDN Git Service

Added updateVisualScroll for setting scroll position without animating.
authorNathanSweet <nathan.sweet@gmail.com>
Fri, 24 May 2013 11:39:22 +0000 (13:39 +0200)
committerNathanSweet <nathan.sweet@gmail.com>
Fri, 24 May 2013 11:39:22 +0000 (13:39 +0200)
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java

index c8e781d..5ed2824 100644 (file)
@@ -657,6 +657,12 @@ public class ScrollPane extends WidgetGroup {
                return amountY;\r
        }\r
 \r
+       /** Sets the visual scroll amount equal to the scroll amount. This can be used when setting the scroll amount without animating. */\r
+       public void updateVisualScroll () {\r
+               visualAmountX = amountX;\r
+               visualAmountY = amountY;\r
+       }\r
+\r
        public float getVisualScrollX () {\r
                return !scrollX ? 0 : visualAmountX;\r
        }\r