You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Merge pull request #87125 from ryevdokimov/fix-removing-preview-nodes-on-ui-cancel
Clear drag preview nodes on `NOTIFICATION_DRAG_END`
This commit is contained in:
@@ -6030,6 +6030,10 @@ void CanvasItemEditorViewport::_notification(int p_what) {
|
|||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
disconnect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit));
|
disconnect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case NOTIFICATION_DRAG_END: {
|
||||||
|
_remove_preview();
|
||||||
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3017,6 +3017,8 @@ void Node3DEditorViewport::_notification(int p_what) {
|
|||||||
// Clear preview material when dropped outside applicable object.
|
// Clear preview material when dropped outside applicable object.
|
||||||
if (spatial_editor->get_preview_material().is_valid() && !is_drag_successful()) {
|
if (spatial_editor->get_preview_material().is_valid() && !is_drag_successful()) {
|
||||||
_remove_preview_material();
|
_remove_preview_material();
|
||||||
|
} else {
|
||||||
|
_remove_preview_node();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user