From e916722e12d3fe6688f1ee4904e035c2949059b8 Mon Sep 17 00:00:00 2001 From: Variable Date: Sun, 15 Sep 2024 10:18:00 +0500 Subject: [PATCH 1/2] Fixed a colorpicker bug --- src/UI/ColorPickers/ColorPicker.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/UI/ColorPickers/ColorPicker.gd b/src/UI/ColorPickers/ColorPicker.gd index 8f837f8eeb4..ccacbca2060 100644 --- a/src/UI/ColorPickers/ColorPicker.gd +++ b/src/UI/ColorPickers/ColorPicker.gd @@ -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. + ## I've noticed that even tho the decimal values change, the HTML remains same after the change. + ## So i'm 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: From 0e1825988eb121537216d3f0d6fd553554ca005f Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 18 Sep 2024 01:08:43 +0300 Subject: [PATCH 2/2] 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. --- src/UI/ColorPickers/ColorPicker.gd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/UI/ColorPickers/ColorPicker.gd b/src/UI/ColorPickers/ColorPicker.gd index ccacbca2060..9f6b46d19fb 100644 --- a/src/UI/ColorPickers/ColorPicker.gd +++ b/src/UI/ColorPickers/ColorPicker.gd @@ -98,11 +98,11 @@ 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. - ## I've noticed that even tho the decimal values change, the HTML remains same after the change. - ## So i'm using this trick to convert the values back to how they are shown in - ## the color picker's UI. + # 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