From 3629647d1338f81d6604ec3e623c89d283f746cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 13 May 2020 07:30:55 +0200 Subject: ui/Label : is always sized acording to it's text --- core/src/ch/asynk/gdx/boardgame/ui/Label.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Label.java b/core/src/ch/asynk/gdx/boardgame/ui/Label.java index 038a4e8..4eb1de6 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Label.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Label.java @@ -27,7 +27,6 @@ public class Label extends Element this.padding = padding; this.alignment = alignment; this.layout = new GlyphLayout(); - this.sizing = Sizing.EXPAND_BOTH; } public String getText() @@ -55,15 +54,9 @@ public class Label extends Element @Override public void computeDimensions() { - if(sizing.fill()) { - super.computeDimensions(); - } else { - if (sizing.expandWidth()) - this.rect.width = (layout.width + (2 * padding)); - if (sizing.expandHeight()) - this.rect.height = (layout.height + (2 * padding)); - if (DEBUG_GEOMETRY) System.err.println(" dim " + print(-1)); - } + this.rect.width = (layout.width + (2 * padding)); + this.rect.height = (layout.height + (2 * padding)); + if (DEBUG_GEOMETRY) System.err.println(" dim " + print(-1)); } @Override public void draw(Batch batch) -- cgit v1.1-2-g2b99