From 497209215066c14d99bbb899cde42ca075c10f34 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Perrier Date: Sat, 27 Feb 2021 20:35:34 +0100 Subject: [PATCH] Fix when no focus. --- Source/Editor/Viewport/EditorViewport.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Editor/Viewport/EditorViewport.cs b/Source/Editor/Viewport/EditorViewport.cs index 68bd5c14d..0e8c17d63 100644 --- a/Source/Editor/Viewport/EditorViewport.cs +++ b/Source/Editor/Viewport/EditorViewport.cs @@ -986,13 +986,6 @@ 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); @@ -1132,6 +1125,14 @@ namespace FlaxEditor.Viewport Vector2 center = PointToWindow(_startPos); win.MousePosition = center; } + + // Change Ortho size on mouse scroll + if (_isOrtho) + { + var scroll = FlaxEngine.Input.MouseScrollDelta; + if (scroll != 0) + _orthoSize -= scroll * 0.2f * _orthoSize; + } } else {