summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-04 15:31:29 +0200
committerGitHub <noreply@github.com>2021-05-04 15:31:29 +0200
commitc26cff7885b24218b987ed49932688c8c086b57c (patch)
tree96e5b2f682bf0133c9e432dd879812c362bf4099
parentc9e874b62db78902b4963e656b3b97b57e93c42f (diff)
parentdcf306f72d95d14cfb5204292db702e226408ceb (diff)
Merge pull request #48444 from KoBeWi/editor_bug_slider
Fixed wrong mouse position after releasing grabber
-rw-r--r--editor/editor_spin_slider.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp
index 8577ccb9db..dba53a9708 100644
--- a/editor/editor_spin_slider.cpp
+++ b/editor/editor_spin_slider.cpp
@@ -70,7 +70,6 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
grabbing_spinner_dist_cache = 0;
pre_grab_value = get_value();
grabbing_spinner = false;
- grabbing_spinner_mouse_pos = Input::get_singleton()->get_mouse_position();
}
} else {
if (grabbing_spinner_attempt) {
@@ -283,6 +282,8 @@ void EditorSpinSlider::_notification(int p_what) {
Rect2 grabber_rect = Rect2(ofs + gofs, svofs + 1, grabber_w, 2 * EDSCALE);
draw_rect(grabber_rect, c);
+ grabbing_spinner_mouse_pos = get_global_position() + grabber_rect.position + grabber_rect.size * 0.5;
+
bool display_grabber = (mouse_over_spin || mouse_over_grabber) && !grabbing_spinner && !value_input_popup->is_visible();
if (grabber->is_visible() != display_grabber) {
if (display_grabber) {