diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-20 11:22:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 11:22:53 +0100 |
commit | bd94c946516d426d5041b01e94403fa24f14b3fd (patch) | |
tree | 1b6415e5b256be711f89310ff1ec68c550c0d98f /editor/plugins | |
parent | 3e8dec3c72402309b061232a2bd61ef936d8f48a (diff) | |
parent | 7e5340261a0c984f64498537c5efb29687a41b5b (diff) |
Merge pull request #33737 from KoBeWi/they_came_from_canvas
Cancel drag when selection changes
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 7 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index fcbd68a60f..b3415c423e 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -794,6 +794,7 @@ bool CanvasItemEditor::_select_click_on_item(CanvasItem *item, Point2 p_click_po editor_selection->add_node(item); // Reselect if (Engine::get_singleton()->is_editor_hint()) { + selected_from_canvas = true; editor->call("edit_node", item); } } @@ -3911,6 +3912,11 @@ void CanvasItemEditor::_selection_changed() { } anchors_mode = (nbValidControls == nbAnchorsMode); anchor_mode_button->set_pressed(anchors_mode); + + if (!selected_from_canvas) { + drag_type = DRAG_NONE; + } + selected_from_canvas = false; } void CanvasItemEditor::edit(CanvasItem *p_canvas_item) { @@ -5253,6 +5259,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_target[0] = SNAP_TARGET_NONE; snap_target[1] = SNAP_TARGET_NONE; + selected_from_canvas = false; anchors_mode = false; skeleton_show_bones = true; diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 3ba66c00f9..74adb882d1 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -252,6 +252,7 @@ private: Point2 view_offset; Point2 previous_update_view_offset; + bool selected_from_canvas; bool anchors_mode; Point2 grid_offset; |