From bd83dc974ec28788a44c430659a9d5701db4ef13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 1 Oct 2018 10:51:13 +0200 Subject: Root/Assembly : call computeGeometry(), add x,y in resize() --- core/src/ch/asynk/gdx/tabletop/ui/Assembly.java | 1 + core/src/ch/asynk/gdx/tabletop/ui/Root.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/ch/asynk/gdx/tabletop/ui/Assembly.java b/core/src/ch/asynk/gdx/tabletop/ui/Assembly.java index 9facd26..e808e50 100644 --- a/core/src/ch/asynk/gdx/tabletop/ui/Assembly.java +++ b/core/src/ch/asynk/gdx/tabletop/ui/Assembly.java @@ -52,6 +52,7 @@ public abstract class Assembly extends Element @Override public void draw(Batch batch) { + if (tainted) computeGeometry(); children.forEach( c -> c.draw(batch) ); } diff --git a/core/src/ch/asynk/gdx/tabletop/ui/Root.java b/core/src/ch/asynk/gdx/tabletop/ui/Root.java index 99d63cf..f887f32 100644 --- a/core/src/ch/asynk/gdx/tabletop/ui/Root.java +++ b/core/src/ch/asynk/gdx/tabletop/ui/Root.java @@ -10,7 +10,12 @@ public class Root extends Assembly public void resize(float width, float height) { - setPosition(0, 0, width, height); + resize(getX(), getY(), width, height); + } + + public void resize(float x, float y, float width, float height) + { + setPosition(x, y, width, height); taint(); } } -- cgit v1.1-2-g2b99