gdiplus: Copy custom dashes in GdipClonePen.
This commit is contained in:
parent
dc047ecdaa
commit
2c3142f0ee
|
@ -102,6 +102,7 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
|
||||||
(*clonepen)->customstart = NULL;
|
(*clonepen)->customstart = NULL;
|
||||||
(*clonepen)->customend = NULL;
|
(*clonepen)->customend = NULL;
|
||||||
(*clonepen)->brush = NULL;
|
(*clonepen)->brush = NULL;
|
||||||
|
(*clonepen)->dashes = NULL;
|
||||||
|
|
||||||
stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);
|
stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);
|
||||||
|
|
||||||
|
@ -111,6 +112,15 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
|
||||||
if (stat == Ok && pen->customend)
|
if (stat == Ok && pen->customend)
|
||||||
stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
|
stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
|
||||||
|
|
||||||
|
if (stat == Ok && pen->dashes)
|
||||||
|
{
|
||||||
|
(*clonepen)->dashes = GdipAlloc(pen->numdashes * sizeof(REAL));
|
||||||
|
if ((*clonepen)->dashes)
|
||||||
|
memcpy((*clonepen)->dashes, pen->dashes, pen->numdashes * sizeof(REAL));
|
||||||
|
else
|
||||||
|
stat = OutOfMemory;
|
||||||
|
}
|
||||||
|
|
||||||
if (stat != Ok)
|
if (stat != Ok)
|
||||||
{
|
{
|
||||||
GdipDeletePen(*clonepen);
|
GdipDeletePen(*clonepen);
|
||||||
|
|
Loading…
Reference in New Issue