From 3472daf97df454295c131ea832ca41f38179f0f8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Perrier Date: Sat, 27 Feb 2021 20:27:06 +0100 Subject: [PATCH] Add ortho scale on MouseScroll. --- Source/Editor/Viewport/EditorViewport.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Editor/Viewport/EditorViewport.cs b/Source/Editor/Viewport/EditorViewport.cs index 00da69343..68bd5c14d 100644 --- a/Source/Editor/Viewport/EditorViewport.cs +++ b/Source/Editor/Viewport/EditorViewport.cs @@ -986,6 +986,13 @@ namespace FlaxEditor.Viewport OnMiddleMouseButtonUp(); } + if (_isOrtho) + { + var scroll = FlaxEngine.Input.MouseScrollDelta; + if (scroll != 0) + _orthoSize -= scroll * 0.2f * _orthoSize; + } + // Get clamped delta time (more stable during lags) var dt = Math.Min(Time.UnscaledDeltaTime, 1.0f);