comparison os2/dw.c @ 1276:1cdc18d760e0

Fixed improper fill method in dw_draw_rect() on OS/2. Also removed some unused variables and fixed some warnings.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 30 Oct 2011 10:19:35 +0000
parents 0b34e2cf0706
children 700dc6818431
comparison
equal deleted inserted replaced
1275:0b34e2cf0706 1276:1cdc18d760e0
8627 * x: X coordinate. 8627 * x: X coordinate.
8628 * y: Y coordinate. 8628 * y: Y coordinate.
8629 * width: Width of rectangle. 8629 * width: Width of rectangle.
8630 * height: Height of rectangle. 8630 * height: Height of rectangle.
8631 */ 8631 */
8632 void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height) 8632 void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int flags, int x, int y, int width, int height)
8633 { 8633 {
8634 HPS hps; 8634 HPS hps;
8635 int thisheight; 8635 int thisheight;
8636 POINTL ptl[2]; 8636 POINTL ptl[2];
8637 8637
8651 ptl[0].x = x; 8651 ptl[0].x = x;
8652 ptl[0].y = thisheight - y - 1; 8652 ptl[0].y = thisheight - y - 1;
8653 ptl[1].x = x + width - 1; 8653 ptl[1].x = x + width - 1;
8654 ptl[1].y = thisheight - y - height; 8654 ptl[1].y = thisheight - y - height;
8655 8655
8656 /* For a filled arc we need to start an area */
8657 if(flags & DW_DRAW_FILL)
8658 GpiBeginArea(hps, 0L);
8659 GpiMove(hps, &ptl[0]); 8656 GpiMove(hps, &ptl[0]);
8660 GpiBox(hps, fill ? DRO_OUTLINEFILL : DRO_OUTLINE, &ptl[1], 0, 0); 8657 GpiBox(hps, (flags & DW_DRAW_FILL) ? DRO_OUTLINEFILL : DRO_OUTLINE, &ptl[1], 0, 0);
8661 if(flags & DW_DRAW_FILL)
8662 GpiEndArea(hps);
8663 8658
8664 if(!pixmap) 8659 if(!pixmap)
8665 WinReleasePS(hps); 8660 WinReleasePS(hps);
8666 } 8661 }
8667 8662
8688 HPS hps; 8683 HPS hps;
8689 int thisheight; 8684 int thisheight;
8690 ARCPARAMS ap = { 1, 1, 0, 0 }; 8685 ARCPARAMS ap = { 1, 1, 0, 0 };
8691 POINTL pts[2]; 8686 POINTL pts[2];
8692 double r, a1, a2, a; 8687 double r, a1, a2, a;
8693 int x3, y3;
8694 8688
8695 /* Handle full circle/ellipse */ 8689 /* Handle full circle/ellipse */
8696 if(flags & DW_DRAW_FULL) 8690 if(flags & DW_DRAW_FULL)
8697 { 8691 {
8698 /* Draw one half... */ 8692 /* Draw one half... */