Fix Editor viewport camera drifting with odd viewport sizes

This commit is contained in:
2023-10-08 17:28:28 +03:00
parent a9dd9adc22
commit 4db1975f02

View File

@@ -1022,7 +1022,7 @@ namespace FlaxEditor.Viewport
// Center mouse position if it's too close to the edge
var size = Size;
var center = size * 0.5f;
var center = Float2.Round(size * 0.5f);
if (Mathf.Abs(_viewMousePos.X - center.X) > center.X * 0.8f || Mathf.Abs(_viewMousePos.Y - center.Y) > center.Y * 0.8f)
{
_viewMousePos = center;