Merge pull request #18988 from godotengine/revert-18981-fix_color_picker

Revert "Fix color-picker sliders"
This commit is contained in:
Rémi Verschelde 2018-05-18 01:50:13 +02:00 committed by GitHub
commit 942e0c4832
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,14 +158,15 @@ void ColorPicker::_update_color() {
updating = true;
for (int i = 0; i < 4; i++) {
if (raw_mode_enabled) {
scroll[i]->set_step(0.01);
if (raw_mode_enabled) {
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);
}
}