- CalcBoundingBox(x1, y1);
- CalcBoundingBox(x2, y2);
-}
-
-void wxDC::DrawArc(long x1,long y1,long x2,long y2, long xc, long yc)
-{
- double dx = xc-x1 ;
- double dy = yc-y1 ;
- double radius = (double)sqrt(dx*dx+dy*dy) ;;
- if (x1==x2 && x2==y2)
- {
- DrawEllipse(xc,yc,(double)(radius*2.0),(double)(radius*2)) ;
- return ;
- }
-
- long xx1 = XLOG2DEV(x1) ;
- long yy1 = YLOG2DEV(y1) ;
- long xx2 = XLOG2DEV(x2) ;
- long yy2 = YLOG2DEV(y2) ;
- long xxc = XLOG2DEV(xc) ;
- long yyc = YLOG2DEV(yc) ;
- long ray = (long) sqrt(double((xxc-xx1)*(xxc-xx1)+(yyc-yy1)*(yyc-yy1))) ;
-
- (void)MoveToEx((HDC) m_hDC, (int) xx1, (int) yy1, NULL);
- long xxx1 = (long) (xxc-ray);
- long yyy1 = (long) (yyc-ray);
- long xxx2 = (long) (xxc+ray);
- long yyy2 = (long) (yyc+ray);
- if (m_brush.Ok() && m_brush.GetStyle() !=wxTRANSPARENT)
- {
- // Have to add 1 to bottom-right corner of rectangle
- // to make semi-circles look right (crooked line otherwise).
- // Unfortunately this is not a reliable method, depends
- // on the size of shape.
- // TODO: figure out why this happens!
- Pie((HDC) m_hDC,xxx1,yyy1,xxx2+1,yyy2+1,
- xx1,yy1,xx2,yy2) ;
- }
- else
- Arc((HDC) m_hDC,xxx1,yyy1,xxx2,yyy2,
- xx1,yy1,xx2,yy2) ;
-
- CalcBoundingBox((xc-radius), (yc-radius));
- CalcBoundingBox((xc+radius), (yc+radius));
-}
-
-void wxDC::DrawPoint(long x, long y)
-{
- COLORREF color = 0x00ffffff;
- if (m_pen.Ok())
- {
- color = m_pen.GetColour().GetPixel() ;
- }
-
- SetPixel((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), color);
-
- CalcBoundingBox(x, y);
-}
-
-void wxDC::DrawPolygon(int n, wxPoint points[], long xoffset, long yoffset,int fillStyle)
-{
- // Do things less efficiently if we have offsets
- if (xoffset != 0 || yoffset != 0)
- {
- POINT *cpoints = new POINT[n];
- int i;
- for (i = 0; i < n; i++)
- {
- cpoints[i].x = (int)(points[i].x + xoffset);
- cpoints[i].y = (int)(points[i].y + yoffset);
-
- CalcBoundingBox(cpoints[i].x, cpoints[i].y);
- }
- int prev = SetPolyFillMode((HDC) m_hDC,fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING) ;
- (void)Polygon((HDC) m_hDC, cpoints, n);
- SetPolyFillMode((HDC) m_hDC,prev) ;
- delete[] cpoints;
- }
- else
- {
- int i;
- for (i = 0; i < n; i++)
- CalcBoundingBox(points[i].x, points[i].y);
-
- int prev = SetPolyFillMode((HDC) m_hDC,fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING) ;
- (void)Polygon((HDC) m_hDC, (POINT*) points, n);
- SetPolyFillMode((HDC) m_hDC,prev) ;
- }
-}
-
-void wxDC::DrawLines(int n, wxPoint points[], long xoffset, long yoffset)
-{
- // Do things less efficiently if we have offsets
- if (xoffset != 0 || yoffset != 0)
- {
- POINT *cpoints = new POINT[n];
- int i;
- for (i = 0; i < n; i++)
- {
- cpoints[i].x = (int)(points[i].x + xoffset);
- cpoints[i].y = (int)(points[i].y + yoffset);