Merge pull request #67832 from Sauermann/fix-remove-unnecessary-casts
Remove unnecessary casts
This commit is contained in:
commit
d1cc93af89
@ -510,7 +510,7 @@ void EditorPropertyArray::_notification(int p_what) {
|
|||||||
change_type->add_separator();
|
change_type->add_separator();
|
||||||
change_type->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Remove Item"), Variant::VARIANT_MAX);
|
change_type->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Remove Item"), Variant::VARIANT_MAX);
|
||||||
|
|
||||||
if (Object::cast_to<Button>(button_add_item)) {
|
if (button_add_item) {
|
||||||
button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
@ -1205,7 +1205,7 @@ void EditorPropertyDictionary::_notification(int p_what) {
|
|||||||
change_type->add_separator();
|
change_type->add_separator();
|
||||||
change_type->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Remove Item"), Variant::VARIANT_MAX);
|
change_type->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Remove Item"), Variant::VARIANT_MAX);
|
||||||
|
|
||||||
if (Object::cast_to<Button>(button_add_item)) {
|
if (button_add_item) {
|
||||||
button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
@ -1431,7 +1431,7 @@ void EditorPropertyLocalizableString::_notification(int p_what) {
|
|||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_THEME_CHANGED:
|
case NOTIFICATION_THEME_CHANGED:
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
if (Object::cast_to<Button>(button_add_item)) {
|
if (button_add_item) {
|
||||||
button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -154,7 +154,7 @@ void EditorPropertyFontMetaOverride::_notification(int p_what) {
|
|||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE:
|
case NOTIFICATION_ENTER_TREE:
|
||||||
case NOTIFICATION_THEME_CHANGED: {
|
case NOTIFICATION_THEME_CHANGED: {
|
||||||
if (Object::cast_to<Button>(button_add)) {
|
if (button_add) {
|
||||||
button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
@ -549,7 +549,7 @@ void EditorPropertyOTFeatures::_notification(int p_what) {
|
|||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE:
|
case NOTIFICATION_ENTER_TREE:
|
||||||
case NOTIFICATION_THEME_CHANGED: {
|
case NOTIFICATION_THEME_CHANGED: {
|
||||||
if (Object::cast_to<Button>(button_add)) {
|
if (button_add) {
|
||||||
button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -3781,7 +3781,7 @@ AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, boo
|
|||||||
if (child) {
|
if (child) {
|
||||||
AABB child_bounds = _calculate_spatial_bounds(child, false);
|
AABB child_bounds = _calculate_spatial_bounds(child, false);
|
||||||
|
|
||||||
if (bounds.size == Vector3() && Object::cast_to<Node3D>(p_parent)) {
|
if (bounds.size == Vector3() && p_parent) {
|
||||||
bounds = child_bounds;
|
bounds = child_bounds;
|
||||||
} else {
|
} else {
|
||||||
bounds.merge_with(child_bounds);
|
bounds.merge_with(child_bounds);
|
||||||
@ -3789,7 +3789,7 @@ AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bounds.size == Vector3() && !Object::cast_to<Node3D>(p_parent)) {
|
if (bounds.size == Vector3() && !p_parent) {
|
||||||
bounds = AABB(Vector3(-0.2, -0.2, -0.2), Vector3(0.4, 0.4, 0.4));
|
bounds = AABB(Vector3(-0.2, -0.2, -0.2), Vector3(0.4, 0.4, 0.4));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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) {
|
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()) {
|
if (!p_node->is_visible()) {
|
||||||
return nullptr; // Canvas item hidden, discard.
|
return nullptr; // Canvas item hidden, discard.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user