summaryrefslogtreecommitdiff
path: root/scene/2d/node_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/node_2d.cpp')
-rw-r--r--scene/2d/node_2d.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 0b7cdafdef..1c0efe773f 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -133,6 +133,14 @@ void Node2D::_update_transform() {
_notify_transform();
}
+void Node2D::reparent(Node *p_parent, bool p_keep_global_transform) {
+ Transform2D temp = get_global_transform();
+ Node::reparent(p_parent);
+ if (p_keep_global_transform) {
+ set_global_transform(temp);
+ }
+}
+
void Node2D::set_position(const Point2 &p_pos) {
if (_xform_dirty) {
const_cast<Node2D *>(this)->_update_xform_values();