OSDN Git Service

Fixed issue 904, scrollpane.
authornathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Fri, 29 Jun 2012 23:50:17 +0000 (23:50 +0000)
committernathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Fri, 29 Jun 2012 23:50:17 +0000 (23:50 +0000)
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java

index 1cba583..5c1c423 100644 (file)
@@ -336,11 +336,6 @@ public class ScrollPane extends WidgetGroup {
                // Set the widget area bounds.\r
                widgetAreaBounds.set(bgLeftWidth, bgBottomHeight, areaWidth, areaHeight);\r
 \r
-               maxX = widgetWidth - areaWidth;\r
-               maxY = widgetHeight - areaHeight;\r
-               amountX = MathUtils.clamp(amountX, 0, maxX);\r
-               amountY = MathUtils.clamp(amountY, 0, maxY);\r
-\r
                // Make sure widgets are drawn under fading scrollbars.\r
                if (fade) {\r
                        if (scrollX && hScrollKnob != null) areaHeight -= hScrollKnob.getMinHeight();\r
@@ -358,6 +353,11 @@ public class ScrollPane extends WidgetGroup {
                        widget.setHeight(widgetHeight);\r
                }\r
 \r
+               maxX = widgetWidth - areaWidth;\r
+               maxY = widgetHeight - areaHeight;\r
+               amountX = MathUtils.clamp(amountX, 0, maxX);\r
+               amountY = MathUtils.clamp(amountY, 0, maxY);\r
+\r
                // Set the bounds and scroll knob sizes if scrollbars are needed.\r
                if (scrollX) {\r
                        if (hScrollKnob != null) {\r