StackOverflowException on PolarGraphics.ToPointF


Hello everyone,
first of all thanks for releasing this amazing library through CodePlex.
I've noticed that on GeoFramework.Drawing.PolarGraphics class, the method ToPointF(PolarCoordinate coordinate) can cause a StackOverFlowException:
182: public PointF ToPointF(PolarCoordinate coordinate)
183: {
184: return ToPointF(coordinate);
185: }
To solve it I've changed to:
184: return coordinate.ToPointF();
In your opinion, is this the right way?


tidyup wrote Apr 28, 2010 at 12:47 PM

See the GPS 3.0 issue on the same topic http://gps3.codeplex.com/WorkItem/View.aspx?WorkItemId=8506 copied below.

The suggested solution is not corect. It will cause problems for Draw PolarGraphics.DrawRotatedString. Try this instead:

/// <summary>Converts a polar coordinate to a precise pixel coordinate.</summary>
public PointF ToPointF(PolarCoordinate coordinate)
return ToPointF(ToPointD(coordinate)); //fixes problems with DrawRotatedString

wrote Feb 14, 2013 at 2:49 AM