Fixed color picker bug

This commit is contained in:
Flairieve 2019-11-29 03:57:56 -06:00
parent 7fdb3fc04c
commit 996433f46d
2 changed files with 3 additions and 4 deletions

View File

@ -1,14 +1,14 @@
tool
extends ColorPickerButton
#TODO: Picking a color from the canvas is actually broken?
var color_picking = false
var mouse_on_top = false
func _ready():
var color_picker = get_picker()
var color_picker_popup = get_popup()
var color_picker_button = color_picker.get_children()[0].get_children()[1]
color_picker_popup.connect("popup_hide", self, "color_picker_popup_hide")
color_picker_button.disconnect("pressed", color_picker, "_screen_pick_pressed")
color_picker_button.connect("pressed", self, "color_picker_button_pressed")
@ -24,7 +24,7 @@ func color_picker_button_pressed():
if not color_picking:
color_picking = true
func _on_ColorPicker_focus_exited():
func color_picker_popup_hide():
color_picking = false
func _on_ColorPicker_mouse_entered():

View File

@ -283,7 +283,6 @@ script = ExtResource( 15 )
[connection signal="pressed" from="ToolMenu/Buttons/BucketTool" to="." method="_on_BucketTool_pressed"]
[connection signal="pressed" from="ToolMenu/Buttons/RainbowTool" to="." method="_on_RainbowTool_pressed"]
[connection signal="color_changed" from="ToolMenu/Buttons/ColorPicker" to="." method="_on_ColorPicker_color_changed"]
[connection signal="focus_exited" from="ToolMenu/Buttons/ColorPicker" to="ToolMenu/Buttons/ColorPicker" method="_on_ColorPicker_focus_exited"]
[connection signal="mouse_entered" from="ToolMenu/Buttons/ColorPicker" to="ToolMenu/Buttons/ColorPicker" method="_on_ColorPicker_mouse_entered"]
[connection signal="mouse_exited" from="ToolMenu/Buttons/ColorPicker" to="ToolMenu/Buttons/ColorPicker" method="_on_ColorPicker_mouse_exited"]
[connection signal="pressed" from="ToolMenu/Layers/Panel/AddLayer" to="ToolMenu/Layers" method="_on_AddLayer_pressed"]