Skip to content

Commit

Permalink
When a reference frame's mean radius is changed in the UI, mark all o…
Browse files Browse the repository at this point in the history
…f that frame's layers as dirty.
  • Loading branch information
Carifio24 committed Feb 1, 2022
1 parent df8324e commit 90f3063
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions WWTExplorer3d/FrameWizardMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit 90f3063

Please sign in to comment.