Merge pull request #31442 from KoBeWi/grounded_grabber

Update Slider grabber position when using mouse wheel
This commit is contained in:
Rémi Verschelde 2019-08-18 11:03:28 +02:00 committed by GitHub
commit d154e55f45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,8 +47,9 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
return;
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT) {
if (mb.is_valid()) {
if (mb->get_button_index() == BUTTON_LEFT) {
if (mb->is_pressed()) {
if (updown_offset != -1 && mb->get_position().x > updown_offset) {
@ -84,6 +85,11 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
grabbing_spinner_attempt = false;
}
}
} else if (mb->get_button_index() == BUTTON_WHEEL_UP || mb->get_button_index() == BUTTON_WHEEL_DOWN) {
if (grabber->is_visible())
call_deferred("update");
}
}
Ref<InputEventMouseMotion> mm = p_event;