Skip to content

Commit

Permalink
Clear drag preview nodes on NOTIFICATION_DRAG_END
Browse files Browse the repository at this point in the history
  • Loading branch information
ryevdokimov committed Feb 3, 2024
1 parent 26b1fd0 commit 7a2c386
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions editor/plugins/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6027,6 +6027,10 @@ void CanvasItemEditorViewport::_notification(int p_what) {
case NOTIFICATION_EXIT_TREE: {
disconnect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit));
} break;

case NOTIFICATION_DRAG_END: {
_remove_preview();
} break;
}
}

Expand Down
2 changes: 2 additions & 0 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3017,6 +3017,8 @@ void Node3DEditorViewport::_notification(int p_what) {
// Clear preview material when dropped outside applicable object.
if (spatial_editor->get_preview_material().is_valid() && !is_drag_successful()) {
_remove_preview_material();
} else {
_remove_preview_node();
}
} break;
}
Expand Down

0 comments on commit 7a2c386

Please sign in to comment.