From 90f3063dbe9c38b8f7dc0739819d0c14d89a8f7e Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Mon, 31 Jan 2022 21:31:24 -0500 Subject: [PATCH] When a reference frame's mean radius is changed in the UI, mark all of that frame's layers as dirty. --- WWTExplorer3d/FrameWizardMain.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WWTExplorer3d/FrameWizardMain.cs b/WWTExplorer3d/FrameWizardMain.cs index ac8d603..2fe7d86 100644 --- a/WWTExplorer3d/FrameWizardMain.cs +++ b/WWTExplorer3d/FrameWizardMain.cs @@ -41,6 +41,7 @@ public override bool Save() { bool failed = false; + double initialMeanRadius = frame.MeanRadius; frame.MeanRadius = ParseAndValidateDouble(MeanRadius, frame.MeanRadius, ref failed); frame.Oblateness = ParseAndValidateDouble(Oblateness, frame.Oblateness, ref failed); frame.Scale = ParseAndValidateDouble(Scale, frame.Scale, ref failed); @@ -52,6 +53,18 @@ public override bool Save() frame.ShowAsPoint = ShowAsPoint.Checked; frame.ShowOrbitPath = ShowOrbitPath.Checked; + + // If the mean radius changes, mark each of the frame's layers as dirty so that it is re-drawn + bool radiusChanged = initialMeanRadius != frame.MeanRadius; + if (radiusChanged && LayerManager.AllMaps.ContainsKey(frame.name)) + { + LayerMap map = LayerManager.AllMaps[frame.name]; + foreach (Layer layer in map.Layers) + { + layer.CleanUp(); + } + } + return !failed; }