1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-07 10:59:49 +00:00

Fix color picker selecting fully transparent pixels that are not black

This commit is contained in:
Emmanouil Papadeas 2024-03-26 02:11:21 +02:00
parent d9888036f2
commit 963819a71a
2 changed files with 3 additions and 3 deletions

View file

@ -730,7 +730,7 @@ func _pick_color(pos: Vector2i) -> void:
if project.layers[idx].is_visible_in_hierarchy(): if project.layers[idx].is_visible_in_hierarchy():
image = curr_frame.cels[idx].get_image() image = curr_frame.cels[idx].get_image()
color = image.get_pixelv(pos) color = image.get_pixelv(pos)
if color != Color(0, 0, 0, 0): if not is_zero_approx(color.a):
break break
var button := ( var button := (
MOUSE_BUTTON_LEFT MOUSE_BUTTON_LEFT

View file

@ -26,7 +26,7 @@ func _on_Options_item_selected(id: int) -> void:
save_config() save_config()
func _on_ExtractFrom_item_selected(index): func _on_ExtractFrom_item_selected(index: int) -> void:
_mode = index _mode = index
update_config() update_config()
save_config() save_config()
@ -80,7 +80,7 @@ func _pick_color(pos: Vector2i) -> void:
if project.layers[idx].is_visible_in_hierarchy(): if project.layers[idx].is_visible_in_hierarchy():
image = curr_frame.cels[idx].get_image() image = curr_frame.cels[idx].get_image()
color = image.get_pixelv(pos) color = image.get_pixelv(pos)
if not color.is_equal_approx(Color(0, 0, 0, 0)): if not is_zero_approx(color.a):
break break
CURRENT_LAYER: CURRENT_LAYER:
color = image.get_pixelv(pos) color = image.get_pixelv(pos)