diff options
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r-- | scene/gui/control.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 235895ce47..e9f1606d66 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -188,10 +188,12 @@ Size2 Control::_edit_get_minimum_size() const { void Control::reparent(Node *p_parent, bool p_keep_global_transform) { ERR_MAIN_THREAD_GUARD; - Transform2D temp = get_global_transform(); - Node::reparent(p_parent); if (p_keep_global_transform) { + Transform2D temp = get_global_transform(); + Node::reparent(p_parent); set_global_position(temp.get_origin()); + } else { + Node::reparent(p_parent); } } |