From b998f7ceb7f47c1eec6cc1d53a2077350e0b9fa2 Mon Sep 17 00:00:00 2001 From: JoNax97 Date: Fri, 2 Jun 2023 10:40:13 -0300 Subject: [PATCH] Gradient: Check if interpolation mode and color space are different before firing notifications. --- scene/resources/gradient.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scene/resources/gradient.cpp b/scene/resources/gradient.cpp index ec4b756a858..afaeb0b52d4 100644 --- a/scene/resources/gradient.cpp +++ b/scene/resources/gradient.cpp @@ -114,6 +114,10 @@ Vector 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(); @@ -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); }