Skip to content

Commit

Permalink
Fix color picker selecting fully transparent pixels that are not black
Browse files Browse the repository at this point in the history
  • Loading branch information
OverloadedOrama committed Mar 26, 2024
1 parent d988803 commit 963819a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Tools/BaseDraw.gd
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ func _pick_color(pos: Vector2i) -> void:
if project.layers[idx].is_visible_in_hierarchy():
image = curr_frame.cels[idx].get_image()
color = image.get_pixelv(pos)
if color != Color(0, 0, 0, 0):
if not is_zero_approx(color.a):
break
var button := (
MOUSE_BUTTON_LEFT
Expand Down
4 changes: 2 additions & 2 deletions src/Tools/UtilityTools/ColorPicker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func _on_Options_item_selected(id: int) -> void:
save_config()


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

0 comments on commit 963819a

Please sign in to comment.