Mercurial > dwindows
comparison os2/dw.c @ 1290:d2c4deea6bf6
Simplified fill for ellipses and circles on OS/2 using DRO_OUTLINEFILL.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 31 Oct 2011 11:36:31 +0000 |
parents | 6a5df80cfb43 |
children | b99b0b2c2826 |
comparison
equal
deleted
inserted
replaced
1289:5fb54aeba5e0 | 1290:d2c4deea6bf6 |
---|---|
8698 thisheight = pixmap->height; | 8698 thisheight = pixmap->height; |
8699 } | 8699 } |
8700 else | 8700 else |
8701 return; | 8701 return; |
8702 | 8702 |
8703 /* For a filled arc we need to start an area */ | |
8704 if(flags & DW_DRAW_FILL) | |
8705 GpiBeginArea(hps, 0L); | |
8706 | |
8707 /* Handle full circle/ellipse */ | 8703 /* Handle full circle/ellipse */ |
8708 if(flags & DW_DRAW_FULL) | 8704 if(flags & DW_DRAW_FULL) |
8709 { | 8705 { |
8710 pts[0].x = xorigin; | 8706 pts[0].x = xorigin; |
8711 pts[0].y = thisheight - yorigin - 1; | 8707 pts[0].y = thisheight - yorigin - 1; |
8712 GpiMove(hps, pts); | 8708 GpiMove(hps, pts); |
8713 ap.lP = (x2 - x1)/2; | 8709 ap.lP = (x2 - x1)/2; |
8714 ap.lQ = (y2 - y1)/2; | 8710 ap.lQ = (y2 - y1)/2; |
8715 /* Setup the arc info on the presentation space */ | 8711 /* Setup the arc info on the presentation space */ |
8716 GpiSetArcParams(hps, &ap); | 8712 GpiSetArcParams(hps, &ap); |
8717 GpiFullArc(hps, DRO_OUTLINE, MAKEFIXED(1, 1)); | 8713 GpiFullArc(hps, (flags & DW_DRAW_FILL) ? DRO_OUTLINEFILL : DRO_OUTLINE, MAKEFIXED(1, 1)); |
8718 } | 8714 } |
8719 else | 8715 else |
8720 { | 8716 { |
8717 /* For a filled arc we need to start an area */ | |
8718 if(flags & DW_DRAW_FILL) | |
8719 GpiBeginArea(hps, 0L); | |
8720 | |
8721 /* Setup the default arc info on the presentation space */ | 8721 /* Setup the default arc info on the presentation space */ |
8722 GpiSetArcParams(hps, &ap); | 8722 GpiSetArcParams(hps, &ap); |
8723 pts[0].x = x1; | 8723 pts[0].x = x1; |
8724 pts[0].y = thisheight - y1 - 1; | 8724 pts[0].y = thisheight - y1 - 1; |
8725 /* Move to the initial position */ | 8725 /* Move to the initial position */ |
8737 pts[0].y = thisheight - (int)(yorigin + r * sin(a)) - 1; | 8737 pts[0].y = thisheight - (int)(yorigin + r * sin(a)) - 1; |
8738 pts[1].x = x2; | 8738 pts[1].x = x2; |
8739 pts[1].y = thisheight - y2 - 1; | 8739 pts[1].y = thisheight - y2 - 1; |
8740 /* Actually draw the arc */ | 8740 /* Actually draw the arc */ |
8741 GpiPointArc(hps, pts); | 8741 GpiPointArc(hps, pts); |
8742 } | 8742 if(flags & DW_DRAW_FILL) |
8743 if(flags & DW_DRAW_FILL) | 8743 GpiEndArea(hps); |
8744 GpiEndArea(hps); | 8744 } |
8745 | 8745 |
8746 if(!pixmap) | 8746 if(!pixmap) |
8747 WinReleasePS(hps); | 8747 WinReleasePS(hps); |
8748 } | 8748 } |
8749 | 8749 |