diff --git a/OemLoader/EphemerisTrajectory.cs b/OemLoader/EphemerisTrajectory.cs index 9364be8..5027d1e 100644 --- a/OemLoader/EphemerisTrajectory.cs +++ b/OemLoader/EphemerisTrajectory.cs @@ -29,8 +29,16 @@ public readonly partial struct EphemerisTrajectory public void DrawTrajectory(Viewport viewport, IParentBody parent, byte4 colour) { if (!Program.DrawUI) return; - + var camera = viewport.GetCamera(); + // If not in map mode, don't draw trajectory line if we are too zoomed in + // (match stock behaviour for orbit lines) + if (viewport.Mode != CameraMode.Map && camera.Following is not null) + { + var distance = camera.DistanceTo(camera.Following.GetPositionEcl()); + if (distance < 500000) return; // constant from KSA.Astronomical.ShouldDrawUiOrLines + } + Span positions = stackalloc float3[Count]; for (var i = 0; i < Count; ++i) {