Implemented invisible pens.
This commit is contained in:
parent
1bb9860547
commit
3471f0f527
|
@ -48,7 +48,7 @@ BOOL PSDRV_LineTo(DC *dc, INT x, INT y)
|
|||
PSDRV_WriteMoveTo(dc, XLPTODP(dc, dc->w.CursPosX),
|
||||
YLPTODP(dc, dc->w.CursPosY));
|
||||
PSDRV_WriteLineTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
|
||||
dc->w.CursPosX = x;
|
||||
dc->w.CursPosY = y;
|
||||
|
@ -73,7 +73,7 @@ BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
|
|||
|
||||
PSDRV_Brush(dc,0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ BOOL PSDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
|
||||
PSDRV_Brush(dc,0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ static BOOL PSDRV_DrawArc( DC *dc, INT left, INT top,
|
|||
PSDRV_Brush(dc,0);
|
||||
}
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -213,11 +213,12 @@ BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
w = XLSTODS(dc, (right - left));
|
||||
h = YLSTODS(dc, (bottom - top));
|
||||
|
||||
PSDRV_WriteNewPath(dc);
|
||||
PSDRV_WriteArc(dc, x, y, w, h, 0.0, 360.0);
|
||||
PSDRV_WriteClosePath(dc);
|
||||
PSDRV_Brush(dc,0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -242,7 +243,7 @@ BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
|
|||
}
|
||||
}
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -282,7 +283,7 @@ BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
|
|||
else /* WINDING */
|
||||
PSDRV_Brush(dc, 0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -313,3 +314,17 @@ COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
|||
PSDRV_WriteFill( dc );
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_DrawLine
|
||||
*/
|
||||
VOID PSDRV_DrawLine( DC *dc )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (physDev->pen.style == PS_NULL)
|
||||
PSDRV_WriteNewPath(dc);
|
||||
else
|
||||
PSDRV_WriteStroke(dc);
|
||||
}
|
||||
|
|
|
@ -33,35 +33,36 @@ extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
|
|||
physDev->pen.width = -physDev->pen.width;
|
||||
|
||||
PSDRV_CreateColor(physDev, &physDev->pen.color, pen->logpen.lopnColor);
|
||||
physDev->pen.style = pen->logpen.lopnStyle & PS_STYLE_MASK;
|
||||
|
||||
if(physDev->pen.width > 1) { /* dashes only for 0 or 1 pixel pens */
|
||||
physDev->pen.dash = NULL;
|
||||
} else {
|
||||
switch(pen->logpen.lopnStyle & PS_STYLE_MASK) {
|
||||
case PS_DASH:
|
||||
physDev->pen.dash = PEN_dash;
|
||||
break;
|
||||
switch(physDev->pen.style) {
|
||||
case PS_DASH:
|
||||
physDev->pen.dash = PEN_dash;
|
||||
break;
|
||||
|
||||
case PS_DOT:
|
||||
physDev->pen.dash = PEN_dot;
|
||||
break;
|
||||
case PS_DOT:
|
||||
physDev->pen.dash = PEN_dot;
|
||||
break;
|
||||
|
||||
case PS_DASHDOT:
|
||||
physDev->pen.dash = PEN_dashdot;
|
||||
break;
|
||||
case PS_DASHDOT:
|
||||
physDev->pen.dash = PEN_dashdot;
|
||||
break;
|
||||
|
||||
case PS_DASHDOTDOT:
|
||||
physDev->pen.dash = PEN_dashdotdot;
|
||||
break;
|
||||
case PS_DASHDOTDOT:
|
||||
physDev->pen.dash = PEN_dashdotdot;
|
||||
break;
|
||||
|
||||
case PS_ALTERNATE:
|
||||
physDev->pen.dash = PEN_alternate;
|
||||
break;
|
||||
case PS_ALTERNATE:
|
||||
physDev->pen.dash = PEN_alternate;
|
||||
break;
|
||||
|
||||
default:
|
||||
physDev->pen.dash = NULL;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
physDev->pen.dash = NULL;
|
||||
}
|
||||
|
||||
if ((physDev->pen.width > 1) && (physDev->pen.dash != NULL)) {
|
||||
physDev->pen.style = PS_SOLID;
|
||||
physDev->pen.dash = NULL;
|
||||
}
|
||||
|
||||
physDev->pen.set = FALSE;
|
||||
|
@ -78,11 +79,13 @@ BOOL PSDRV_SetPen(DC *dc)
|
|||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
PSDRV_WriteSetColor(dc, &physDev->pen.color);
|
||||
if (physDev->pen.style != PS_NULL) {
|
||||
PSDRV_WriteSetColor(dc, &physDev->pen.color);
|
||||
|
||||
if(!physDev->pen.set) {
|
||||
PSDRV_WriteSetPen(dc);
|
||||
physDev->pen.set = TRUE;
|
||||
if(!physDev->pen.set) {
|
||||
PSDRV_WriteSetPen(dc);
|
||||
physDev->pen.set = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -205,6 +205,7 @@ typedef struct {
|
|||
} PSBRUSH;
|
||||
|
||||
typedef struct {
|
||||
INT style;
|
||||
INT width;
|
||||
char *dash;
|
||||
PSCOLOR color;
|
||||
|
@ -369,7 +370,7 @@ extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
|
|||
LPCSTR lpszPort,
|
||||
WORD fwCapability, LPSTR lpszOutput,
|
||||
LPDEVMODEA lpdm);
|
||||
|
||||
VOID PSDRV_DrawLine( DC *dc );
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue