Remove unnecessary casts

button_add_item and button_add are both Button

p_parent is a Node3D

CanvasItem can never be cast to Viewport
This commit is contained in:
Markus Sauermann
2022-10-24 15:59:18 +02:00
parent 040f49ed6e
commit 5ee449efec
4 changed files with 7 additions and 11 deletions
-4
View File
@@ -1403,10 +1403,6 @@ Control *Viewport::gui_find_control(const Point2 &p_global) {
}
Control *Viewport::_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform, Transform2D &r_inv_xform) {
if (Object::cast_to<Viewport>(p_node)) {
return nullptr;
}
if (!p_node->is_visible()) {
return nullptr; // Canvas item hidden, discard.
}