From bd6f7a411c8b2a9e163e01d52a303333eac4fe78 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Thu, 21 Jan 2016 14:08:40 +0100 Subject: Fix wrong local mouse pos when holding spinbox and improve behaviour --- scene/gui/spin_box.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scene/gui/spin_box.cpp') diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 38c61ded2c..2b64d36a81 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -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()) { -- cgit v1.2.3