Skip to content

Commit

Permalink
Fix rotated map not displaying vehicle (ArduPilot#3266)
Browse files Browse the repository at this point in the history
  • Loading branch information
EosBandi authored Jan 12, 2024
1 parent 90a62ef commit 196958a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,6 @@ public void doPaint(IGraphics e)
{
{
e.Clear(EmptyMapBackground);

#if !PocketPC
if (MapRenderTransform.HasValue)
{
Expand Down Expand Up @@ -1507,8 +1506,9 @@ public void doPaint(IGraphics e)
}
#endif
DrawMap(e);
OnPaintOverlays(e);
}
OnPaintOverlays(e);

}
}

Expand Down
2 changes: 1 addition & 1 deletion ExtLibs/Maps/GMapMarkerQuad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public override void OnRender(IGraphics g)
{
var temp = g.Transform;
g.TranslateTransform(LocalPosition.X, LocalPosition.Y);
// set centerpoint as 0,0
g.TranslateTransform(-Offset.X, -Offset.Y);
g.RotateTransform(-Overlay.Control.Bearing);

// anti NaN
try
Expand Down
8 changes: 8 additions & 0 deletions GCSViews/ConfigurationView/ConfigPlanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@ private void CHK_maprotation_CheckedChanged(object sender, EventArgs e)
if (startup)
return;
Settings.Instance["CHK_maprotation"] = CHK_maprotation.Checked.ToString();
if (CHK_maprotation.Checked)
{
chk_shownofly.Checked = false;
}
FlightData.instance.gMapControl1.Bearing = 0;
}

Expand Down Expand Up @@ -987,6 +991,10 @@ private void CHK_AutoParamCommit_CheckedChanged(object sender, EventArgs e)
private void chk_shownofly_CheckedChanged(object sender, EventArgs e)
{
Settings.Instance["ShowNoFly"] = chk_shownofly.Checked.ToString();
if (chk_shownofly.Checked)
{
CHK_maprotation.Checked = false;
}
}

private void CMB_altunits_SelectedIndexChanged(object sender, EventArgs e)
Expand Down
10 changes: 9 additions & 1 deletion GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3593,8 +3593,16 @@ private void mainloop()

if (Settings.Instance.GetBoolean("CHK_maprotation"))
{
// dont holdinvalidation here
////Check if we have more than one vehicle connected and disable CHK_maprotation if so
if (MainV2.comPort.MAVlist.Count > 1)
{
Settings.Instance["CHK_maprotation"] = "false";
//And set maprotation to zero
BeginInvoke((Action)delegate { gMapControl1.Bearing = 0; });
}
//gMapControl1.HoldInvalidation = true;
setMapBearing();

}

if (route == null)
Expand Down

0 comments on commit 196958a

Please sign in to comment.