Fix Editor viewport camera transformation getting corrupted when focused

This commit is contained in:
2023-09-17 17:05:20 +03:00
parent fa96707c57
commit 02a219a376
+6 -1
View File
@@ -1119,7 +1119,12 @@ namespace FlaxEditor.Viewport
var win = (WindowRootControl)Root;
// Get current mouse position in the view
_viewMousePos = PointFromWindow(win.MousePosition);
{
// When the window is not focused, the position in window does not return sane values
Float2 pos = PointFromWindow(win.MousePosition);
if (!float.IsInfinity(pos.LengthSquared))
_viewMousePos = pos;
}
// Update input
var window = win.Window;