Commit f1fae5ea authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdiplus: GdipCreatePen2 should make a copy of the brush.

parent d9fa8738
...@@ -88,14 +88,19 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit, ...@@ -88,14 +88,19 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
GpPen **pen) GpPen **pen)
{ {
GpBrush *brush; GpBrush *brush;
GpStatus status;
GdipCreateSolidFill(color, (GpSolidFill **)(&brush)); GdipCreateSolidFill(color, (GpSolidFill **)(&brush));
return GdipCreatePen2(brush, width, unit, pen); status = GdipCreatePen2(brush, width, unit, pen);
GdipDeleteBrush(brush);
return status;
} }
GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
GpPen **pen) GpPen **pen)
{ {
GpPen *gp_pen; GpPen *gp_pen;
GpBrush *clone_brush;
if(!pen || !brush) if(!pen || !brush)
return InvalidParameter; return InvalidParameter;
...@@ -111,7 +116,6 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, ...@@ -111,7 +116,6 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
gp_pen->miterlimit = 10.0; gp_pen->miterlimit = 10.0;
gp_pen->dash = DashStyleSolid; gp_pen->dash = DashStyleSolid;
gp_pen->offset = 0.0; gp_pen->offset = 0.0;
gp_pen->brush = brush;
if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) { if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
FIXME("UnitWorld, UnitPixel only supported units\n"); FIXME("UnitWorld, UnitPixel only supported units\n");
...@@ -119,6 +123,9 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, ...@@ -119,6 +123,9 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
return NotImplemented; return NotImplemented;
} }
GdipCloneBrush(brush, &clone_brush);
gp_pen->brush = clone_brush;
*pen = gp_pen; *pen = gp_pen;
return Ok; return Ok;
......
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