diff options
-rw-r--r-- | core/src/ch/asynk/rustanddust/ui/Widget.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/ui/Widget.java b/core/src/ch/asynk/rustanddust/ui/Widget.java index 6605158..9460833 100644 --- a/core/src/ch/asynk/rustanddust/ui/Widget.java +++ b/core/src/ch/asynk/rustanddust/ui/Widget.java @@ -66,8 +66,13 @@ public abstract class Widget implements Disposable, Drawable public void setParent(Widget parent) { - float x, y; this.parent = parent; + update(); + } + + public void update() + { + float x, y; if (parent == null) { x = position.getX(rect.width); y = position.getY(rect.height); |