From 4c100daf83890422e9487923e1d0ef3c6c64a678 Mon Sep 17 00:00:00 2001 From: originalnicodr Date: Sun, 2 Feb 2025 18:42:30 -0300 Subject: [PATCH] Fixed bug when disabling orthographic property on freecam --- src/UI/Panels/FreeCamPanel.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index eca01e2..b91b216 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -345,13 +345,19 @@ namespace UnityExplorer.UI.Panels } static void MaybeToggleOrthographic(bool enable){ - // If we want to enable orthographic view but never disabled it don't do anything - if (enable && !disabledOrthographic) - return; - - if (ourCamera){ - ourCamera.orthographic = enable; - disabledOrthographic = !enable; + if (ourCamera) { + if (enable) { + // Only re-enable orthographic mode if we previously disabled it + if (disabledOrthographic) { + ourCamera.orthographic = true; + disabledOrthographic = false; + } + } else { + if (ourCamera.orthographic) { + disabledOrthographic = true; + ourCamera.orthographic = false; + } + } } }