Fix wrong local mouse pos when holding spinbox and improve behaviour

This commit is contained in:
Ignacio Etcheverry
2016-01-21 14:08:40 +01:00
parent d1bb868a19
commit bd6f7a411c
2 changed files with 7 additions and 8 deletions

View File

@ -72,8 +72,7 @@ void SpinBox::_range_click_timeout() {
if (!drag.enabled && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) {
int pos_y = Input::get_singleton()->get_mouse_pos().y-get_global_pos().y;
bool up = pos_y < (get_size().height/2);
bool up = get_local_mouse_pos().y < (get_size().height/2);
set_val( get_val() + (up?get_step():-get_step()));
if (range_click_timer->is_one_shot()) {