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

KML overlay: Fix missing default color or width linestyle errors #3444

Merged
merged 2 commits into from
Nov 12, 2024
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
18 changes: 14 additions & 4 deletions GCSViews/FlightPlanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5176,12 +5176,22 @@ private void processKML(Element Element, Document root = null)
{
if (((Style)style).Line != null)
{
int color = ((Style)style).Line.Color.Value.Abgr;
int color;
if (((Style)style).Line.Color != null)
{
color = ((Style)style).Line.Color.Value.Abgr;
color = (int)((color & 0xFF00FF00) | ((color & 0x00FF0000) >> 16) | ((color & 0x000000FF) << 16));

}
else color = Color.White.ToArgb();
// convert color from ABGR to ARGB
color = (int)((color & 0xFF00FF00) | ((color & 0x00FF0000) >> 16) | ((color & 0x000000FF) << 16));

// ABGR
return (Color.FromArgb(color), (int)((Style)style).Line.Width.Value);
if (((Style)style).Line.Width != null)
{
return (Color.FromArgb(color), (int)((Style)style).Line.Width.Value);
}
else
return (Color.FromArgb(color), 2);
}
}
}
Expand Down
Loading