Mercurial > dwindows
comparison os2/dw.c @ 1274:885b55c0d7d7
Implemented DW_DRAW_FULL and DW_DRAW_FILL on OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 30 Oct 2011 02:13:47 +0000 |
parents | 4b0aa8429592 |
children | 0b34e2cf0706 |
comparison
equal
deleted
inserted
replaced
1273:dfecd7b3c81e | 1274:885b55c0d7d7 |
---|---|
8683 int thisheight; | 8683 int thisheight; |
8684 ARCPARAMS ap = { 1, 1, 0, 0 }; | 8684 ARCPARAMS ap = { 1, 1, 0, 0 }; |
8685 POINTL pts[2]; | 8685 POINTL pts[2]; |
8686 double r, a1, a2, a; | 8686 double r, a1, a2, a; |
8687 int x3, y3; | 8687 int x3, y3; |
8688 | 8688 |
8689 /* Handle full circle/ellipse */ | |
8690 if(flags & DW_DRAW_FULL) | |
8691 { | |
8692 /* Draw one half... */ | |
8693 dw_draw_arc(handle, pixmap, flags & ~DW_DRAW_FULL, xorigin, yorigin, x2, y2, x1, y1); | |
8694 /* ... then continue to draw the other half */ | |
8695 } | |
8696 | |
8689 if(handle) | 8697 if(handle) |
8690 { | 8698 { |
8691 hps = _set_colors(handle); | 8699 hps = _set_colors(handle); |
8692 thisheight = _get_height(handle); | 8700 thisheight = _get_height(handle); |
8693 } | 8701 } |
8696 hps = _set_hps(pixmap->hps); | 8704 hps = _set_hps(pixmap->hps); |
8697 thisheight = pixmap->height; | 8705 thisheight = pixmap->height; |
8698 } | 8706 } |
8699 else | 8707 else |
8700 return; | 8708 return; |
8701 | 8709 |
8710 /* For a filled polygon we need to start an area */ | |
8711 if(flags & DW_DRAW_FILL) | |
8712 GpiBeginArea(hps, 0L); | |
8702 /* Setup the arc info on the presentation space */ | 8713 /* Setup the arc info on the presentation space */ |
8703 GpiSetArcParams(hps, &ap); | 8714 GpiSetArcParams(hps, &ap); |
8704 pts[0].x = x1; | 8715 pts[0].x = x1; |
8705 pts[0].y = thisheight - y1 - 1; | 8716 pts[0].y = thisheight - y1 - 1; |
8706 /* Move to the initial position */ | 8717 /* Move to the initial position */ |
8718 pts[0].y = thisheight - (int)(yorigin + r * sin(a)) - 1; | 8729 pts[0].y = thisheight - (int)(yorigin + r * sin(a)) - 1; |
8719 pts[1].x = x2; | 8730 pts[1].x = x2; |
8720 pts[1].y = thisheight - y2 - 1; | 8731 pts[1].y = thisheight - y2 - 1; |
8721 /* Actually draw the arc */ | 8732 /* Actually draw the arc */ |
8722 GpiPointArc(hps, pts); | 8733 GpiPointArc(hps, pts); |
8734 if(flags & DW_DRAW_FILL) | |
8735 GpiEndArea(hps); | |
8723 | 8736 |
8724 if(!pixmap) | 8737 if(!pixmap) |
8725 WinReleasePS(hps); | 8738 WinReleasePS(hps); |
8726 } | 8739 } |
8727 | 8740 |