Merge pull request #38918 from EricEzaM/fix-slider-focus-on-scroll-input

Fixed issue with slider focus and scroll input
This commit is contained in:
Rémi Verschelde 2021-02-25 18:09:04 +01:00 committed by GitHub
commit 494e1cb148
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,8 +73,10 @@ void Slider::_gui_input(Ref<InputEvent> p_event) {
}
} else if (scrollable) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_UP) {
grab_focus();
set_value(get_value() + get_step());
} else if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_DOWN) {
grab_focus();
set_value(get_value() - get_step());
}
}