1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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

View File

@@ -154,7 +154,7 @@ void EditorPropertyFontMetaOverride::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
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")));
}
} break;
@@ -549,7 +549,7 @@ void EditorPropertyOTFeatures::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
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")));
}
} break;