Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark layers as dirty when their reference frame's mean radius changes #205

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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