You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Improve Ctrl snapping in EditorSpinSlider
- Remove FPS dependency by using a simpler implementation that just rounds the final number - Make it possible to combine Ctrl and Shift together for slow, precise snapping
This commit is contained in:
@@ -109,13 +109,8 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (grabbing_spinner) {
|
if (grabbing_spinner) {
|
||||||
if (mm->get_control() || updown_offset != -1) {
|
if (mm->get_control()) {
|
||||||
set_value(Math::round(get_value()));
|
set_value(Math::round(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10));
|
||||||
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();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
set_value(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10);
|
set_value(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user