You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Update if == NOTIFICATION_* to switch statements to match coding style
This commit is contained in:
@@ -91,13 +91,15 @@ GradientEditor::GradientEditor() {
|
||||
///////////////////////
|
||||
|
||||
void GradientReverseButton::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("ReverseGradient"), SNAME("EditorIcons"));
|
||||
if (is_pressed()) {
|
||||
draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height()), false, get_theme_color(SNAME("icon_pressed_color"), SNAME("Button")));
|
||||
} else {
|
||||
draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height()));
|
||||
}
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_DRAW: {
|
||||
Ref<Texture2D> icon = get_theme_icon(SNAME("ReverseGradient"), SNAME("EditorIcons"));
|
||||
if (is_pressed()) {
|
||||
draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height()), false, get_theme_color(SNAME("icon_pressed_color"), SNAME("Button")));
|
||||
} else {
|
||||
draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height()));
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user