Fix Direction Gizmo axes placement in ortho view

#3857
This commit is contained in:
Wojtek Figat
2026-03-25 18:11:31 +01:00
parent 27a1db617c
commit 842b25f80f

View File

@@ -192,6 +192,8 @@ internal class DirectionGizmo : ContainerControl
// Normalize by viewport height to keep size independent of FOV and viewport dimensions
float heightNormalization = _viewport.Height / 720.0f; // 720 = reference height
if (_owner.Viewport.UseOrthographicProjection)
heightNormalization /= _owner.Viewport.OrthographicScale * 0.5f; // Fix in ortho view to keep consistent size regardless of zoom level
Float2 xDelta = (xProjected - gizmoCenterScreen) / heightNormalization;
Float2 yDelta = (yProjected - gizmoCenterScreen) / heightNormalization;