diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-05-18 01:50:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-18 01:50:13 +0200 |
commit | 942e0c483247af1e84b7992be48f8ef6317d45c6 (patch) | |
tree | f8f493cea624a9b59cbfd1134294e5bdf77bfd2b /scene | |
parent | 7eddb80b27f9846bb24d5757c23c5003fd5b1a6d (diff) | |
parent | e8dce91481649f56da6aa48f8f5c23bccd9e648a (diff) |
Merge pull request #18988 from godotengine/revert-18981-fix_color_picker
Revert "Fix color-picker sliders"
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/color_picker.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 84793110f0..34891832e2 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -158,14 +158,15 @@ void ColorPicker::_update_color() { updating = true; for (int i = 0; i < 4; i++) { + scroll[i]->set_step(0.01); if (raw_mode_enabled) { - scroll[i]->set_step(0.01); - scroll[i]->set_max(1); + scroll[i]->set_max(100); + if (i == 3) + scroll[i]->set_max(1); scroll[i]->set_value(color.components[i]); } else { - scroll[i]->set_step(1); - scroll[i]->set_max(255); const int byte_value = color.components[i] * 255; + scroll[i]->set_max(next_power_of_2(MAX(255, byte_value)) - 1); scroll[i]->set_value(byte_value); } } |