]> git.saurik.com Git - wxWidgets.git/commitdiff
Patch [ 1816051 ] MSW DrawEllipticArc inconsistent with other platforms
authorRobin Dunn <robin@alldunn.com>
Mon, 22 Oct 2007 18:06:57 +0000 (18:06 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 22 Oct 2007 18:06:57 +0000 (18:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dc.cpp

index 56748f75185151b079b48008ecb9eb04b6f262c4..fa9c434fb42869c77117581e0b8f4ffd376f414d 100644 (file)
@@ -1122,6 +1122,17 @@ void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,d
     rx2 += (int)(100.0 * abs(w) * cos(ea));
     ry2 -= (int)(100.0 * abs(h) * m_signY * sin(ea));
 
+    // Swap start and end positions if the end angle is less than the start angle.
+    if (ea < sa) {
+       int temp;
+       temp = rx2;
+       rx2 = rx1;
+       rx1 = temp;
+       temp = ry2;
+       ry2 = ry1;
+       ry1 = temp;
+    }
+
     // draw pie with NULL_PEN first and then outline otherwise a line is
     // drawn from the start and end points to the centre
     HPEN hpenOld = (HPEN) ::SelectObject(GetHdc(), (HPEN) ::GetStockObject(NULL_PEN));