Skip to content

Commit

Permalink
Gradient: Check if interpolation mode and color space are different b…
Browse files Browse the repository at this point in the history
…efore firing notifications.
  • Loading branch information
JoNax97 committed Jun 2, 2023
1 parent afb2480 commit b998f7c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scene/resources/gradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ Vector<Color> Gradient::get_colors() const {
}

void Gradient::set_interpolation_mode(Gradient::InterpolationMode p_interp_mode) {
if (p_interp_mode == interpolation_mode) {
return;
}

interpolation_mode = p_interp_mode;
emit_signal(CoreStringNames::get_singleton()->changed);
notify_property_list_changed();
Expand All @@ -124,6 +128,10 @@ Gradient::InterpolationMode Gradient::get_interpolation_mode() {
}

void Gradient::set_interpolation_color_space(Gradient::ColorSpace p_color_space) {
if (p_color_space == interpolation_color_space) {
return;
}

interpolation_color_space = p_color_space;
emit_signal(CoreStringNames::get_singleton()->changed);
}
Expand Down

0 comments on commit b998f7c

Please sign in to comment.