Update Slider grabber position when using mouse wheel

This commit is contained in:
Tomasz Chabora 2019-08-17 21:12:05 +02:00
parent 86371b7298
commit 8a0e6e23a7

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;