mirror of
https://github.com/godotengine/godot.git
synced 2025-01-23 02:52:28 -05:00
Add MagnifyGesture to Advanced Import dialog zooming
This commit is contained in:
parent
b9437c3938
commit
f1b3f17ae3
1 changed files with 14 additions and 0 deletions
|
@ -1224,6 +1224,20 @@ void SceneImportSettingsDialog::_viewport_input(const Ref<InputEvent> &p_input)
|
|||
}
|
||||
_update_camera();
|
||||
}
|
||||
Ref<InputEventMagnifyGesture> 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() {
|
||||
|
|
Loading…
Reference in a new issue