@@ -12,6 +12,7 @@ var shape_aspect_ratio: AspectRatioContainer
12
12
var swatches_button : Button
13
13
## The internal container for the color sliders of the [ColorPicker] node.
14
14
var color_sliders_vbox : VBoxContainer
15
+ var _skip_color_picker_update := false
15
16
@onready var color_picker := % ColorPicker as ColorPicker
16
17
@onready var color_buttons := % ColorButtons as HBoxContainer
17
18
@onready var left_color_rect := % LeftColorRect as ColorRect
@@ -105,10 +106,7 @@ func _on_color_picker_color_changed(color: Color) -> void:
105
106
# So we're using this trick to convert the values back to how they are shown in
106
107
# the color picker's UI.
107
108
color = Color (color .to_html ())
108
- if Tools .picking_color_for == MOUSE_BUTTON_RIGHT :
109
- right_color_rect .color = color
110
- else :
111
- left_color_rect .color = color
109
+ _skip_color_picker_update = true
112
110
Tools .assign_color (color , Tools .picking_color_for )
113
111
114
112
@@ -130,7 +128,7 @@ func reset_options() -> void:
130
128
131
129
func update_color (color_info : Dictionary , button : int ) -> void :
132
130
var color = color_info .get ("color" , Color .WHITE )
133
- if Tools .picking_color_for == button :
131
+ if Tools .picking_color_for == button and not _skip_color_picker_update :
134
132
color_picker .color = color
135
133
if button == MOUSE_BUTTON_RIGHT :
136
134
right_color_rect .color = color
@@ -139,6 +137,7 @@ func update_color(color_info: Dictionary, button: int) -> void:
139
137
_average (left_color_rect .color , right_color_rect .color )
140
138
Global .config_cache .set_value ("color_picker" , "color_mode" , color_picker .color_mode )
141
139
Global .config_cache .set_value ("color_picker" , "picker_shape" , color_picker .picker_shape )
140
+ _skip_color_picker_update = false
142
141
143
142
144
143
func _on_ColorSwitch_pressed () -> void :
0 commit comments