diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-26 08:42:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-26 08:42:53 +0200 |
commit | 37cf49ae0ed9f2fbcd1acaefc858ac1607ed000c (patch) | |
tree | f5ee25188181f6065596b25dca9897beb807c8c0 /editor | |
parent | 084481b79da1515e2acd9be68e13aec67e35e80b (diff) | |
parent | 84d0f324c4a4fa5936e69e2f13b626a95635d8d6 (diff) |
Merge pull request #32017 from Calinou/editor-spin-slider-improve-ctrl-snapping
Improve Ctrl snapping in EditorSpinSlider
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_spin_slider.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 35fe366526..918b0ef96d 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -109,13 +109,8 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { } if (grabbing_spinner) { - if (mm->get_control() || updown_offset != -1) { - set_value(Math::round(get_value())); - if (ABS(grabbing_spinner_dist_cache) > 6) { - set_value(get_value() + SGN(grabbing_spinner_dist_cache)); - grabbing_spinner_dist_cache = 0; - pre_grab_value = get_value(); - } + if (mm->get_control()) { + set_value(Math::round(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10)); } else { set_value(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10); } |