From f1b3f17ae36059f6297379df5b61e7c8058b4ad4 Mon Sep 17 00:00:00 2001 From: Patrick Exner Date: Wed, 22 May 2024 04:20:14 +0200 Subject: [PATCH] Add MagnifyGesture to Advanced Import dialog zooming --- editor/import/3d/scene_import_settings.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/editor/import/3d/scene_import_settings.cpp b/editor/import/3d/scene_import_settings.cpp index 7bb68349b2b..61f48df7e4f 100644 --- a/editor/import/3d/scene_import_settings.cpp +++ b/editor/import/3d/scene_import_settings.cpp @@ -1224,6 +1224,20 @@ void SceneImportSettingsDialog::_viewport_input(const Ref &p_input) } _update_camera(); } + Ref mg = p_input; + if (mg.is_valid()) { + real_t mg_factor = mg->get_factor(); + if (mg_factor == 0.0) { + mg_factor = 1.0; + } + (*zoom) /= mg_factor; + if ((*zoom) < 0.1) { + (*zoom) = 0.1; + } else if ((*zoom) > 10.0) { + (*zoom) = 10.0; + } + _update_camera(); + } } void SceneImportSettingsDialog::_re_import() {