OSDN Git Service

Fixed pref width.
authorNathanSweet <nathan.sweet@gmail.com>
Thu, 30 May 2013 12:30:53 +0000 (14:30 +0200)
committerNathanSweet <nathan.sweet@gmail.com>
Thu, 30 May 2013 12:30:53 +0000 (14:30 +0200)
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/SelectBox.java

index 7ab3a31..1cc4320 100644 (file)
@@ -118,8 +118,8 @@ public class SelectBox extends Widget {
                for (int i = 0; i < items.length; i++)\r
                        max = Math.max(font.getBounds(items[i]).width, max);\r
                prefWidth = bg.getLeftWidth() + bg.getRightWidth() + max;\r
-               prefWidth = Math.max(prefWidth, max + style.listBackground.getLeftWidth() + style.listBackground.getRightWidth() + 2\r
-                       * style.itemSpacing);\r
+               prefWidth = Math.max(prefWidth, max + style.listBackground.getLeftWidth() + style.listBackground.getRightWidth()\r
+                       + style.listSelection.getLeftWidth() + style.listSelection.getRightWidth());\r
 \r
                if (items.length > 0) {\r
                        ChangeEvent changeEvent = Pools.obtain(ChangeEvent.class);\r
@@ -313,7 +313,6 @@ public class SelectBox extends Widget {
                public Drawable listSelection;\r
                public BitmapFont font;\r
                public Color fontColor = new Color(1, 1, 1, 1);\r
-               public float itemSpacing = 10;\r
 \r
                public SelectBoxStyle () {\r
                }\r