From 717d32f5f90910e0146cdf019cc672f61c4a7b99 Mon Sep 17 00:00:00 2001 From: Tomasz Chabora Date: Mon, 17 Feb 2020 19:40:18 +0100 Subject: [PATCH] Reset origin of dragged scene preview --- editor/plugins/canvas_item_editor_plugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index f7a3b500524a..0d98dccc8728 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5901,6 +5901,15 @@ void CanvasItemEditorViewport::_create_preview(const Vector &files) cons Node *instance = scene->instance(); if (instance) { preview_node->add_child(instance); + + Node2D *n = Object::cast_to(instance); + if (n) { + n->set_position(Vector2()); + } + Control *c = Object::cast_to(instance); + if (c) { + c->set_begin(Point2()); + } } } }