File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,15 @@ func _on_RemoveColorButton_pressed() -> void:
122122 arr .append (c )
123123 index += 1
124124 _palette .colors = PackedColorArray (arr )
125-
126- _color_grid .remove_child (_active_button )
125+
126+ _color_grid .remove_child (_active_button )
127+
128+ var buttonIndex : int = 0
129+ for button : PaletteButton in _color_grid .get_children ():
130+ button .pressed .disconnect (_on_platte_button_pressed )
131+ button .pressed .connect (_on_platte_button_pressed .bind (button , buttonIndex ))
132+ buttonIndex += 1
133+
127134 _active_button_index = min (_active_button_index , _color_grid .get_child_count () - 1 )
128135 _active_button = _color_grid .get_child (_active_button_index )
129136 _on_platte_button_pressed (_active_button , _color_grid .get_child_count () - 1 )
You can’t perform that action at this time.
0 commit comments