Commit 717ac52d authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Use the mode passed to GdipCreateLineBrushFromRect.

parent aaee4d7f
......@@ -309,10 +309,35 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
if(!line || !rect)
return InvalidParameter;
start.X = rect->X;
start.Y = rect->Y;
end.X = rect->X + rect->Width;
end.Y = rect->Y + rect->Height;
switch (mode)
{
case LinearGradientModeHorizontal:
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);
......
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