diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-24 09:51:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-24 09:51:25 +0200 |
commit | 78a7db7b6b7d58d4854022e5568e82f9980d2fdb (patch) | |
tree | df337486c4bc8737ba0c99700b01ecc484c9d1ae | |
parent | 329c54453e8121325c28da9765bb97edd9dfce31 (diff) | |
parent | 5476250356d1e7de225e512764bf6dd1d355651a (diff) |
Merge pull request #32224 from KoBeWi/not_so_smart_lines
Initialize snap_target and make sure it disappears
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 6f612b5c79..625ca5e603 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1967,6 +1967,11 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { if (key_auto_insert_button->is_pressed()) { _insert_animation_keys(true, false, false, true); } + + //Make sure smart snapping lines disappear. + snap_target[0] = SNAP_TARGET_NONE; + snap_target[1] = SNAP_TARGET_NONE; + drag_type = DRAG_NONE; viewport->update(); return true; @@ -1975,6 +1980,8 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { // Cancel a drag if (b.is_valid() && b->get_button_index() == BUTTON_RIGHT && b->is_pressed()) { _restore_canvas_item_state(drag_selection, true); + snap_target[0] = SNAP_TARGET_NONE; + snap_target[1] = SNAP_TARGET_NONE; drag_type = DRAG_NONE; viewport->update(); return true; @@ -5044,6 +5051,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_rotation = false; snap_relative = false; snap_pixel = false; + snap_target[0] = SNAP_TARGET_NONE; + snap_target[1] = SNAP_TARGET_NONE; anchors_mode = false; |