summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaosus <chaosus89@gmail.com>2019-06-28 17:25:00 +0300
committerChaosus <chaosus89@gmail.com>2019-06-28 17:25:00 +0300
commiteb6e2609187606820ab158719d219dd4ee636831 (patch)
tree1abe49c0ecc592ff0272a28c5453ecd10f6fe22f
parent6e03236574467d6a0c3aca1b0375da59423b0083 (diff)
Fix some bugs inside ColorPicker
-rw-r--r--scene/gui/color_picker.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 58a0762469..b197971b61 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -173,7 +173,7 @@ void ColorPicker::_value_changed(double) {
color.set_hsv(scroll[0]->get_value() / 360.0,
scroll[1]->get_value() / 100.0,
scroll[2]->get_value() / 100.0,
- scroll[3]->get_value() / 100.0);
+ scroll[3]->get_value() / 255.0);
} else {
for (int i = 0; i < 4; i++) {
color.components[i] = scroll[i]->get_value() / (raw_mode_enabled ? 1.0 : 255.0);
@@ -209,17 +209,17 @@ void ColorPicker::_update_color(bool p_update_sliders) {
if (hsv_mode_enabled) {
for (int i = 0; i < 4; i++) {
- scroll[i]->set_step(0.1);
+ scroll[i]->set_step(1.0);
}
- scroll[0]->set_max(360);
+ scroll[0]->set_max(359);
scroll[0]->set_value(h * 360.0);
scroll[1]->set_max(100);
scroll[1]->set_value(s * 100.0);
scroll[2]->set_max(100);
scroll[2]->set_value(v * 100.0);
- scroll[3]->set_max(100);
- scroll[3]->set_value(color.components[3] * 100.0);
+ scroll[3]->set_max(255);
+ scroll[3]->set_value(color.components[3] * 255.0);
} else {
for (int i = 0; i < 4; i++) {
if (raw_mode_enabled) {