gdiplus: Store the rectangle in line gradient brushes.
This commit is contained in:
parent
550d02e1ad
commit
173a1f6f79
@ -250,6 +250,11 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
|
|||||||
(*line)->wrap = wrap;
|
(*line)->wrap = wrap;
|
||||||
(*line)->gamma = FALSE;
|
(*line)->gamma = FALSE;
|
||||||
|
|
||||||
|
(*line)->rect.X = (startpoint->X < endpoint->X ? startpoint->X: endpoint->X);
|
||||||
|
(*line)->rect.Y = (startpoint->Y < endpoint->Y ? startpoint->Y: endpoint->Y);
|
||||||
|
(*line)->rect.Width = fabs(startpoint->X - endpoint->X);
|
||||||
|
(*line)->rect.Height = fabs(startpoint->Y - endpoint->Y);
|
||||||
|
|
||||||
(*line)->blendcount = 1;
|
(*line)->blendcount = 1;
|
||||||
(*line)->blendfac = GdipAlloc(sizeof(REAL));
|
(*line)->blendfac = GdipAlloc(sizeof(REAL));
|
||||||
(*line)->blendpos = GdipAlloc(sizeof(REAL));
|
(*line)->blendpos = GdipAlloc(sizeof(REAL));
|
||||||
@ -1538,11 +1543,7 @@ GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
|
|||||||
if(!brush || !rect)
|
if(!brush || !rect)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
rect->X = (brush->startpoint.X < brush->endpoint.X ? brush->startpoint.X: brush->endpoint.X);
|
*rect = brush->rect;
|
||||||
rect->Y = (brush->startpoint.Y < brush->endpoint.Y ? brush->startpoint.Y: brush->endpoint.Y);
|
|
||||||
|
|
||||||
rect->Width = fabs(brush->startpoint.X - brush->endpoint.X);
|
|
||||||
rect->Height = fabs(brush->startpoint.Y - brush->endpoint.Y);
|
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
@ -143,6 +143,7 @@ struct GpLineGradient{
|
|||||||
GpPointF endpoint;
|
GpPointF endpoint;
|
||||||
ARGB startcolor;
|
ARGB startcolor;
|
||||||
ARGB endcolor;
|
ARGB endcolor;
|
||||||
|
RectF rect;
|
||||||
GpWrapMode wrap;
|
GpWrapMode wrap;
|
||||||
BOOL gamma;
|
BOOL gamma;
|
||||||
REAL* blendfac; /* blend factors */
|
REAL* blendfac; /* blend factors */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user