Skip to content

Commit

Permalink
Fixed a colorpicker bug (fixed inconsistent raw values) (#1108)
Browse files Browse the repository at this point in the history
* Fixed a colorpicker bug

* Some changes in the comments

We should probably avoid using "I" in comments, as it's not clear who is speaking, and `##` should only be used for documentation string and not normal comments.

---------

Co-authored-by: Emmanouil Papadeas <[email protected]>
  • Loading branch information
Variable-ind and OverloadedOrama authored Sep 17, 2024
1 parent b5ded76 commit 51f6816
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/UI/ColorPickers/ColorPicker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ func _notification(what: int) -> void:


func _on_color_picker_color_changed(color: Color) -> void:
# Due to the decimal nature of the color values, some values get rounded off
# unintentionally before entering this method.
# Even though the decimal values change, the HTML code remains the same after the change.
# So we're using this trick to convert the values back to how they are shown in
# the color picker's UI.
color = Color(color.to_html())
if Tools.picking_color_for == MOUSE_BUTTON_RIGHT:
right_color_rect.color = color
else:
Expand Down

0 comments on commit 51f6816

Please sign in to comment.