Mercurial > dwindows
diff mac/dw.m @ 1275:0b34e2cf0706
Updated dw_draw_rect and dw_draw_polygon to accept flags the same way as dw_draw_arc.
The fill parameter has been replaced by flags which should be backwards compatible.
Also updated the source comments to reflect these changes.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 30 Oct 2011 10:14:49 +0000 |
parents | 9e477efbacca |
children | 107e38a29eeb |
line wrap: on
line diff
--- a/mac/dw.m Sun Oct 30 02:13:47 2011 +0000 +++ b/mac/dw.m Sun Oct 30 10:14:49 2011 +0000 @@ -5117,13 +5117,13 @@ * Parameters: * handle: Handle to the window. * pixmap: Handle to the pixmap. (choose only one of these) - * fill: Fill box TRUE or FALSE. + * flags: DW_DRAW_FILL (1) to fill the polygon or DW_DRAW_DEFAULT (0). * x: X coordinate. * y: Y coordinate. * width: Width of rectangle. * height: Height of rectangle. */ -void API dw_draw_polygon( HWND handle, HPIXMAP pixmap, int fill, int npoints, int *x, int *y ) +void API dw_draw_polygon( HWND handle, HPIXMAP pixmap, int flags, int npoints, int *x, int *y ) { int _locked_by_me = FALSE; DW_MUTEX_LOCK; @@ -5156,7 +5156,7 @@ [aPath lineToPoint:NSMakePoint(x[z], y[z])]; } [aPath closePath]; - if(fill) + if(flags & DW_DRAW_FILL) { [aPath fill]; } @@ -5176,13 +5176,13 @@ * Parameters: * handle: Handle to the window. * pixmap: Handle to the pixmap. (choose only one of these) - * fill: Fill box TRUE or FALSE. + * flags: DW_DRAW_FILL (1) to fill the box or DW_DRAW_DEFAULT (0). * x: X coordinate. * y: Y coordinate. * width: Width of rectangle. * height: Height of rectangle. */ -void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height) +void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int flags, int x, int y, int width, int height) { int _locked_by_me = FALSE; DW_MUTEX_LOCK; @@ -5213,7 +5213,7 @@ [aPath lineToPoint:NSMakePoint(x + width, y + height)]; [aPath lineToPoint:NSMakePoint(x + width, y)]; [aPath closePath]; - if(fill) + if(flags & DW_DRAW_FILL) [aPath fill]; [aPath stroke]; if(pixmap) @@ -5231,7 +5231,8 @@ * Parameters: * handle: Handle to the window. * pixmap: Handle to the pixmap. (choose only one of these) - * flags: For future use. + * flags: DW_DRAW_FILL (1) to fill the arc or DW_DRAW_DEFAULT (0). + * DW_DRAW_FULL will draw a complete circle/elipse. * xorigin: X coordinate of center of arc. * yorigin: Y coordinate of center of arc. * x1: X coordinate of first segment of arc. @@ -5267,7 +5268,7 @@ NSColor *color = pthread_getspecific(_dw_fg_color_key); [color set]; - /* Special state of a full circle/oval */ + /* Special case of a full circle/oval */ if(flags & DW_DRAW_FULL) { [aPath appendBezierPathWithOvalInRect:NSMakeRect(x1, y1, x2, y2)];