mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Changed various editor transform operations to be committed in local instead of global space. Fixed a couple of bugs when syncing transforms to debug instance.
This commit is contained in:
parent
89cc635c05
commit
97f9dbda81
3 changed files with 74 additions and 19 deletions
|
|
@ -5775,7 +5775,11 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
|
|||
|
||||
// there's nothing to be used as source position so snapping will work as absolute if enabled
|
||||
target_position = canvas_item_editor->snap_point(target_position);
|
||||
undo_redo->add_do_method(child, "set_global_position", target_position);
|
||||
|
||||
CanvasItem *parent_ci = Object::cast_to<CanvasItem>(parent);
|
||||
Point2 local_target_pos = parent_ci ? parent_ci->get_global_transform().xform_inv(target_position) : target_position;
|
||||
|
||||
undo_redo->add_do_method(child, "set_position", local_target_pos);
|
||||
}
|
||||
|
||||
bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue