Fix the distance for grabbing a EditorSpinSlider

Currently moving the mouse for a single pixel is enough to trigger
grabbing, which happens often unintentionally.
This commit is contained in:
Markus Sauermann 2023-06-16 09:21:22 +02:00
parent c0d8d91b15
commit 42402aa7db

View file

@ -106,7 +106,7 @@ void EditorSpinSlider::gui_input(const Ref<InputEvent> &p_event) {
}
grabbing_spinner_dist_cache += diff_x * grabbing_spinner_speed;
if (!grabbing_spinner && ABS(grabbing_spinner_dist_cache) > 4 * EDSCALE) {
if (!grabbing_spinner && ABS(grabbing_spinner_dist_cache) > 4 * grabbing_spinner_speed * EDSCALE) {
Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_CAPTURED);
grabbing_spinner = true;
}