Mercurial > dwindows
changeset 1285:2c04a56eaf63
Switched to using arcparams and GpiFullArc on OS/2 to draw the ellipse.
Now that I understand how it works from info here:
http://cyberkinetica.homeunix.net/os2tk45/gpi4/158_L5_DefininganEllipse.html
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 31 Oct 2011 08:49:57 +0000 |
parents | 8cb3650eb242 |
children | 6a5df80cfb43 |
files | os2/dw.c |
diffstat | 1 files changed, 10 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/os2/dw.c Mon Oct 31 06:06:09 2011 +0000 +++ b/os2/dw.c Mon Oct 31 08:49:57 2011 +0000 @@ -8703,34 +8703,23 @@ /* For a filled arc we need to start an area */ if(flags & DW_DRAW_FILL) GpiBeginArea(hps, 0L); - /* Setup the arc info on the presentation space */ - GpiSetArcParams(hps, &ap); /* Handle full circle/ellipse */ if(flags & DW_DRAW_FULL) { - int xmid = ((x2 - x1)/2) + x1; - int ymid = ((y2 - y1)/2) + y1; - - /* Draw one half... */ - pts[0].x = x1; - pts[0].y = thisheight - ymid - 1; + pts[0].x = xorigin; + pts[0].y = thisheight - yorigin - 1; GpiMove(hps, pts); - pts[0].x = xmid; - pts[0].y = thisheight - y1 - 1; - pts[1].x = x2; - pts[1].y = thisheight - ymid - 1; - GpiPointArc(hps, pts); - /* ... then continue to draw the other half */ - GpiMove(hps, &pts[1]); - pts[0].x = xmid; - pts[0].y = thisheight - y2 - 1; - pts[1].x = x1; - pts[1].y = thisheight - ymid - 1; - GpiPointArc(hps, pts); - } + ap.lP = (x2 - x1)/2; + ap.lQ = (y2 - y1)/2; + /* Setup the arc info on the presentation space */ + GpiSetArcParams(hps, &ap); + GpiFullArc(hps, DRO_OUTLINE, MAKEFIXED(1, 1)); + } else { + /* Setup the default arc info on the presentation space */ + GpiSetArcParams(hps, &ap); pts[0].x = x1; pts[0].y = thisheight - y1 - 1; /* Move to the initial position */