gdiplus: Store the rectangle in line gradient brushes.

This commit is contained in:
Vincent Povirk 2009-05-07 11:33:28 -05:00 committed by Alexandre Julliard
parent 550d02e1ad
commit 173a1f6f79
2 changed files with 7 additions and 5 deletions

View file

@ -250,6 +250,11 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
(*line)->wrap = wrap;
(*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)->blendfac = GdipAlloc(sizeof(REAL));
(*line)->blendpos = GdipAlloc(sizeof(REAL));
@ -1538,11 +1543,7 @@ GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
if(!brush || !rect)
return InvalidParameter;
rect->X = (brush->startpoint.X < brush->endpoint.X ? brush->startpoint.X: brush->endpoint.X);
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);
*rect = brush->rect;
return Ok;
}

View file

@ -143,6 +143,7 @@ struct GpLineGradient{
GpPointF endpoint;
ARGB startcolor;
ARGB endcolor;
RectF rect;
GpWrapMode wrap;
BOOL gamma;
REAL* blendfac; /* blend factors */