gdiplus: Use the mode passed to GdipCreateLineBrushFromRect.

This commit is contained in:
Vincent Povirk 2009-05-06 16:36:06 -05:00 committed by Alexandre Julliard
parent aaee4d7f9d
commit 717ac52dda

View file

@ -309,10 +309,35 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
if(!line || !rect) if(!line || !rect)
return InvalidParameter; return InvalidParameter;
start.X = rect->X; switch (mode)
start.Y = rect->Y; {
end.X = rect->X + rect->Width; case LinearGradientModeHorizontal:
end.Y = rect->Y + rect->Height; start.X = rect->X;
start.Y = rect->Y;
end.X = rect->X + rect->Width;
end.Y = rect->Y;
break;
case LinearGradientModeVertical:
start.X = rect->X;
start.Y = rect->Y;
end.X = rect->X;
end.Y = rect->Y + rect->Height;
break;
case LinearGradientModeForwardDiagonal:
start.X = rect->X;
start.Y = rect->Y;
end.X = rect->X + rect->Width;
end.Y = rect->Y + rect->Height;
break;
case LinearGradientModeBackwardDiagonal:
start.X = rect->X + rect->Width;
start.Y = rect->Y;
end.X = rect->X;
end.Y = rect->Y + rect->Height;
break;
default:
return InvalidParameter;
}
stat = GdipCreateLineBrush(&start, &end, startcolor, endcolor, wrap, line); stat = GdipCreateLineBrush(&start, &end, startcolor, endcolor, wrap, line);