1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Fixed issue with color picker tool, picking the wrong color value

The color picker was picking color values left over from an undo operation. Meaning, if you drew something and then undid it, the color picker would pick the color before the undo.
This commit is contained in:
OverloadedOrama 2020-05-11 01:46:24 +03:00
parent b4ae097d14
commit cf1530d338

View file

@ -458,7 +458,10 @@ func _input(event : InputEvent) -> void:
Global.selection_rectangle.polygon[3] = Vector2(start_pos.x, end_pos.y)
"ColorPicker":
if can_handle:
var pixel_color : Color = sprite.get_pixelv(mouse_pos)
var image_data := Image.new()
image_data.copy_from(sprite)
image_data.lock()
var pixel_color : Color = image_data.get_pixelv(mouse_pos)
if color_picker_for == 0: # Pick for the left color
Global.left_color_picker.color = pixel_color
Global.update_left_custom_brush()