diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-01 10:51:13 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-01 10:51:13 +0200 |
commit | bd83dc974ec28788a44c430659a9d5701db4ef13 (patch) | |
tree | c688a965bb79cd8b85f38e8eedf9b765bf6160f4 /core/src/ch/asynk/gdx/tabletop/ui | |
parent | 3c3a3a2bf261462221d456ebab6ba568713c144e (diff) | |
download | gdx-boardgame-bd83dc974ec28788a44c430659a9d5701db4ef13.zip gdx-boardgame-bd83dc974ec28788a44c430659a9d5701db4ef13.tar.gz |
Root/Assembly : call computeGeometry(), add x,y in resize()
Diffstat (limited to 'core/src/ch/asynk/gdx/tabletop/ui')
-rw-r--r-- | core/src/ch/asynk/gdx/tabletop/ui/Assembly.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/tabletop/ui/Root.java | 7 |
2 files changed, 7 insertions, 1 deletions
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(); } } |