Commit 18c20964 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Add support for PS_INSIDEFRAME pens when drawing rectangles.

parent c861284a
......@@ -83,7 +83,7 @@ typedef struct dibdrv_physdev
/* pen */
COLORREF pen_colorref;
DWORD pen_endcap, pen_join;
DWORD pen_style, pen_endcap, pen_join;
int pen_width;
dash_pattern pen_pattern;
dash_pos dash_pos;
......
......@@ -580,6 +580,14 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
if(defer_pen(pdev))
return next->funcs->pRectangle( next, left, top, right, bottom );
if (pdev->pen_style == PS_INSIDEFRAME)
{
rect.left += pdev->pen_width / 2;
rect.top += pdev->pen_width / 2;
rect.right -= (pdev->pen_width - 1) / 2;
rect.bottom -= (pdev->pen_width - 1) / 2;
}
reset_dash_origin(pdev);
/* 4 pts going anti-clockwise starting from top-right */
......
......@@ -1279,7 +1279,6 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSelectPen );
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
LOGPEN logpen;
DWORD style;
TRACE("(%p, %p)\n", dev, hpen);
......@@ -1315,11 +1314,12 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
pdev->defer |= DEFER_PEN;
style = logpen.lopnStyle & PS_STYLE_MASK;
pdev->pen_style = logpen.lopnStyle & PS_STYLE_MASK;
switch(style)
switch (pdev->pen_style)
{
case PS_SOLID:
case PS_INSIDEFRAME:
if(pdev->pen_width <= 1)
pdev->pen_lines = solid_pen_lines;
else
......@@ -1334,7 +1334,7 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
if(logpen.lopnStyle & PS_GEOMETRIC) break;
if(logpen.lopnWidth.x > 1) break;
pdev->pen_lines = dashed_pen_lines;
pdev->pen_pattern = dash_patterns[style];
pdev->pen_pattern = dash_patterns[pdev->pen_style];
pdev->defer &= ~DEFER_PEN;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment