Skip to content

Commit d042771

Browse files
Fixed aspect ratio breaking when hotsampling in ForcedMatrix freecam mode.
1 parent df5a154 commit d042771

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Binary file not shown.

src/UI/Panels/FreeCamPanel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,7 @@ public FreeCamBehaviour(IntPtr ptr) : base(ptr) { }
12361236
private Quaternion cachedRotation;
12371237
private CamPaths cachedCamPathsPanel;
12381238
private bool? hasHDRPComponent = null;
1239+
private float cachedAspectRatio = -1f;
12391240

12401241
internal void Update()
12411242
{
@@ -1283,6 +1284,11 @@ internal void Update()
12831284
FreeCamPanel.connector?.ExecuteCameraCommand(FreeCamPanel.GetFreecam());
12841285

12851286
FreeCamPanel.UpdatePositionInput();
1287+
if (FreeCamPanel.cameraMatrixOverrider != null && Mathf.Abs(FreeCamPanel.ourCamera.aspect - cachedAspectRatio) > 0.001f)
1288+
{
1289+
FreeCamPanel.cameraMatrixOverrider.ResetAspect();
1290+
cachedAspectRatio = FreeCamPanel.ourCamera.aspect;
1291+
}
12861292
}
12871293
}
12881294

0 commit comments

Comments
 (0)