Mercurial > dwindows
changeset 1632:fdf874f25076
Fixed full arcs with GDI+ and disabled antialiased rendering for rectangles.
Code for rectangles is still present, #ifdefed out... but other platforms
do not seem to currently antialias rectangles, so disabling for now.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 28 Mar 2012 19:17:08 +0000 |
parents | 0e6c2aeed041 |
children | c441c85baa57 |
files | win/dw.c |
diffstat | 1 files changed, 9 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/win/dw.c Wed Mar 28 18:33:54 2012 +0000 +++ b/win/dw.c Wed Mar 28 19:17:08 2012 +0000 @@ -9864,7 +9864,7 @@ */ void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int flags, int x, int y, int width, int height) { - #ifdef GDIPLUS + #ifdef GDIPLUS1 if(!(flags & DW_DRAW_NOAA)) { GpGraphics *graphics = NULL; @@ -9929,11 +9929,6 @@ */ void API dw_draw_arc(HWND handle, HPIXMAP pixmap, int flags, int xorigin, int yorigin, int x1, int y1, int x2, int y2) { - double dx = xorigin - x1; - double dy = yorigin - y1; - double r = sqrt(dx*dx + dy*dy); - int ri = (int)r; - #ifdef GDIPLUS if(!(flags & DW_DRAW_NOAA)) { @@ -9954,17 +9949,17 @@ { GpBrush *brush = TlsGetValue(_gpBrush); - GdipFillEllipseI(graphics, brush, xorigin-ri, yorigin-ri, xorigin+ri, yorigin+ri); + GdipFillEllipseI(graphics, brush, x1 < x2 ? x1 : x2, y1 < y2 ? y1 : y2, abs(x1-x2), abs(y1-y2)); } else - GdipDrawEllipseI(graphics, pen, xorigin-ri, yorigin-ri, xorigin+ri, yorigin+ri); + GdipDrawEllipseI(graphics, pen, x1 < x2 ? x1 : x2, y1 < y2 ? y1 : y2, abs(x1-x2), abs(y1-y2)); } else { double a1 = atan2((y1-yorigin), (x1-xorigin)); double a2 = atan2((y2-yorigin), (x2-xorigin)); - GdipDrawArcI(graphics, pen, xorigin-ri, yorigin-ri, xorigin+ri, yorigin+ri, (REAL)a1, (REAL)a2); + GdipDrawArcI(graphics, pen, x1 < x2 ? x1 : x2, y1 < y2 ? y1 : y2, abs(x1-x2), abs(y1-y2), (REAL)a1, (REAL)a2); } GdipDeleteGraphics(graphics); } @@ -9974,7 +9969,11 @@ HDC hdcPaint; HBRUSH oldBrush; HPEN oldPen; - + double dx = xorigin - x1; + double dy = yorigin - y1; + double r = sqrt(dx*dx + dy*dy); + int ri = (int)r; + if(handle) hdcPaint = GetDC(handle); else if(pixmap)