From 78f139da6fc8ebe4a1a2c3316404aa1b9460cab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 13 May 2020 07:36:39 +0200 Subject: ui/List : is always sized according to it's content --- core/src/ch/asynk/gdx/boardgame/ui/List.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/core/src/ch/asynk/gdx/boardgame/ui/List.java b/core/src/ch/asynk/gdx/boardgame/ui/List.java index 3e050a6..da1c33f 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/List.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/List.java @@ -32,7 +32,6 @@ public class List extends Element this.selected = new Bg(selected); this.selected.setParent(this); this.selected.visible = false; - this.sizing = Sizing.EXPAND_BOTH; } public void unselect() { idx = null; } @@ -73,16 +72,9 @@ public class List extends Element if (layout.width > w) w = layout.width; } itemHeight = (layout.height + spacing); - if (sizing.fill()) { - super.computeDimensions(); - } else if (sizing.expand()) { - - if (sizing.expandWidth()) - rect.width = w + (2 * padding); - if (sizing.expandHeight()) - rect.height = (itemHeight * items.size()) + (2 * padding) - spacing; - if (DEBUG_GEOMETRY) System.err.println(" dim " + print(-1)); - } + rect.width = w + (2 * padding); + rect.height = (itemHeight * items.size()) + (2 * padding) - spacing; + if (DEBUG_GEOMETRY) System.err.println(" dim " + print(-1)); } @Override public void computePosition() -- cgit v1.1-2-g2b99