Merge pull request #18981 from capnm/fix_color_picker
Fix color-picker sliders
This commit is contained in:
commit
2aafd92831
1 changed files with 4 additions and 5 deletions
|
@ -158,15 +158,14 @@ void ColorPicker::_update_color() {
|
||||||
updating = true;
|
updating = true;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
scroll[i]->set_step(0.01);
|
|
||||||
if (raw_mode_enabled) {
|
if (raw_mode_enabled) {
|
||||||
scroll[i]->set_max(100);
|
scroll[i]->set_step(0.01);
|
||||||
if (i == 3)
|
|
||||||
scroll[i]->set_max(1);
|
scroll[i]->set_max(1);
|
||||||
scroll[i]->set_value(color.components[i]);
|
scroll[i]->set_value(color.components[i]);
|
||||||
} else {
|
} else {
|
||||||
|
scroll[i]->set_step(1);
|
||||||
|
scroll[i]->set_max(255);
|
||||||
const int byte_value = color.components[i] * 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);
|
scroll[i]->set_value(byte_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue