1
Vote

Compass crashes on Desktop

description

Calls to PolarGrahics.ToPointF(PolarCoordinate coordinate) cause infinitely recursive call.
 
/// <summary>Converts a polar coordinate to a precise pixel coordinate.</summary>
public PointF ToPointF(PolarCoordinate coordinate)
{
184: return ToPointF(coordinate);
}

I think it's suppose to perform an explicit cast to PointD:
 
public PointF ToPointF(PolarCoordinate coordinate)
{
return ToPointF((PointD)coordinate);
}

comments

tidyup wrote Mar 30, 2010 at 4:21 AM

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 
}

tidyup wrote Mar 30, 2010 at 4:24 AM

Arrgggghh format gone crazy and no edit for the comments... Moderator please delete my previous comment. It should read:

/// <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 21, 2013 at 10:51 PM