From cdc1902b681c3b3d4b0f48bd77948db8907c9dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 17 May 2016 17:33:22 +0200 Subject: Widget: add update() called by setParent(Widget) --- core/src/ch/asynk/rustanddust/ui/Widget.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit v1.1-2-g2b99