You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object. This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary. A few small changes also had to be made to other files, due to the changes cascading down all the includes.
This commit is contained in:
@@ -3977,7 +3977,7 @@ void CanvasItemEditor::_selection_changed() {
|
||||
|
||||
void CanvasItemEditor::edit(CanvasItem *p_canvas_item) {
|
||||
Array selection = editor_selection->get_selected_nodes();
|
||||
if (selection.size() != 1 || (Node *)selection[0] != p_canvas_item) {
|
||||
if (selection.size() != 1 || Object::cast_to<Node>(selection[0]) != p_canvas_item) {
|
||||
drag_type = DRAG_NONE;
|
||||
|
||||
// Clear the selection
|
||||
|
||||
Reference in New Issue
Block a user