GDI - Issue while drawing Arc
I am trying to make, Arc, Using GDI. There is a problem that I am facing while rendering Arc for the angles life, 90 to 91, 180 to 181, 270 to 271. Following is the code and output snapshot.
// Create a geometric pen.
logBrush.lbStyle = BS_SOLID;
logBrush.lbColor = RGB(0,0,0);
CPen myPen2(PS_SOLID|PS_GEOMETRIC|PS_ENDCAP_SQUARE |PS_JOIN_MITER, 50, &logBrush);
// First arc of 270 degree
pDC->Arc(100,100,300,300,200,100,100,200);//at angle 270
// second arc of 90 degree
pDC->AngleArc(450, 400, 150, 0.0f, 90.0f);
Here is the output :
THIS OUTPUT IS CORRECT :D ... Follow the below small step to get the unexpected behaviour.
and when I change the angle the output is wiered. Check by changing the last parameter of first arc to 202 instead of 200. And change the angle, of second arc to 91.0f, to see the problem.
this is only happening for angles like, 91, 181, 271. I am not sure how this is happening, may be some quadrant related calculations are causing this. :S
Can anybody tell me how I can fix this issue ? Is this related to joints ? can you guide me what exactly is SetMiterLimit(...) does ?
Is this is API issue ?
Thanks in advance.