Was a bit shocked to discover that System.Drawing.PointF
appears to have operators for subtracting sizes but not other PointFs. So I'm trying to write my own PointF class, but it needs to be able to have System.Drawing.Points automatically converted to it, or it really doesn't add any convenience. So I wrote these constructors:
public PointF(float x = 0, float y = 0)
{
this.x = x;
this.y = y;
}
public PointF(System.Drawing.PointF p) : this(p.X, p.Y) { }
public PointF(System.Drawing.Point p) : this(p.X, p.Y) { }
But I'm still getting this error:
cannot convert from 'System.Drawing.Point' to 'my_namespace.PointF'
(I have a function that accepts a my_namespace.PointF
but I'm passing in a System.Drawing.Point
).
Shouldn't the 3rd constructor kick in and auto-convert it?