Merge pull request #32017 from Calinou/editor-spin-slider-improve-ctrl-snapping
Improve Ctrl snapping in EditorSpinSlider
This commit is contained in:
commit
37cf49ae0e
1 changed files with 2 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue