OSDN Git Service

fixed issue 1250, selectbox issues
authorbadlogic <badlogicgames@gmail.com>
Sat, 16 Mar 2013 23:18:27 +0000 (00:18 +0100)
committerbadlogic <badlogicgames@gmail.com>
Sat, 16 Mar 2013 23:18:27 +0000 (00:18 +0100)
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/SelectBox.java
tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglDebugStarter.java

index 27dc20a..6e0a7cc 100644 (file)
@@ -214,7 +214,7 @@ public class SelectBox extends Widget {
                                x = tmpCoords.x;\r
                                y = tmpCoords.y;\r
                                if (x > 0 && x < getWidth() && y > 0 && y < getHeight()) {\r
-                                       listSelectedIndex = (int)((getHeight() - y) / itemHeight);\r
+                                       listSelectedIndex = (int) ((getHeight() - style.listBackground.getTopHeight() - y) / itemHeight);\r
                                        listSelectedIndex = Math.max(0, listSelectedIndex);\r
                                        listSelectedIndex = Math.min(items.length - 1, listSelectedIndex);\r
                                        selectedIndex = listSelectedIndex;\r
index e342a7b..82d75e2 100644 (file)
@@ -41,9 +41,10 @@ public class LwjglDebugStarter {
                new SharedLibraryLoader("../../extensions/gdx-controllers/gdx-controllers-desktop/libs/gdx-controllers-desktop-natives.jar").load("gdx-controllers-desktop");\r
                new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx");\r
 \r
-               GdxTest test = new AnimationTest();\r
-               LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();\r
-               config.useGL20 = test.needsGL20();\r
-               new LwjglApplication(test, config);\r
+               MathUtils.atan2(-6.0E-44f,0f);\r
+//             GdxTest test = new AnimationTest();\r
+//             LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();\r
+//             config.useGL20 = test.needsGL20();\r
+//             new LwjglApplication(test, config);\r
        }\r
 }\r