diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/color_picker.cpp | 5 | ||||
-rw-r--r-- | scene/gui/item_list.cpp | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index b99128e65f..6ed465562e 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -176,14 +176,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(100); if (i == 3) scroll[i]->set_max(1); scroll[i]->set_value(color.components[i]); } else { - const int byte_value = color.components[i] * 255; + scroll[i]->set_step(1); + const float byte_value = color.components[i] * 255.0; scroll[i]->set_max(next_power_of_2(MAX(255, byte_value)) - 1); scroll[i]->set_value(byte_value); } diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index f5521cccd5..efe452305b 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -715,9 +715,9 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { } } else if (p_event->is_action("ui_cancel")) { search_string = ""; - } else if (p_event->is_action("ui_select")) { + } else if (p_event->is_action("ui_select") && select_mode == SELECT_MULTI) { - if (select_mode == SELECT_MULTI && current >= 0 && current < items.size()) { + if (current >= 0 && current < items.size()) { if (items[current].selectable && !items[current].disabled && !items[current].selected) { select(current, false); emit_signal("multi_selected", current, true); |