Commit d3de57c2 authored by Shawn M. Chapla's avatar Shawn M. Chapla Committed by Alexandre Julliard

gdiplus: Use FromRect constructor in LinearGradientBrush deserialization.

parent 6c787852
......@@ -2202,7 +2202,7 @@ static GpStatus metafile_deserialize_brush(const BYTE *record_data, UINT data_si
case BrushTypeLinearGradient:
{
GpLineGradient *gradient = NULL;
GpPointF startpoint, endpoint;
GpRectF rect;
UINT position_count = 0;
offset = header_size + FIELD_OFFSET(EmfPlusLinearGradientBrushData, OptionalData);
......@@ -2240,13 +2240,14 @@ static GpStatus metafile_deserialize_brush(const BYTE *record_data, UINT data_si
return InvalidParameter;
}
startpoint.X = data->BrushData.lineargradient.RectF.X;
startpoint.Y = data->BrushData.lineargradient.RectF.Y;
endpoint.X = startpoint.X + data->BrushData.lineargradient.RectF.Width;
endpoint.Y = startpoint.Y + data->BrushData.lineargradient.RectF.Height;
rect.X = data->BrushData.lineargradient.RectF.X;
rect.Y = data->BrushData.lineargradient.RectF.Y;
rect.Width = data->BrushData.lineargradient.RectF.Width;
rect.Height = data->BrushData.lineargradient.RectF.Height;
status = GdipCreateLineBrush(&startpoint, &endpoint, data->BrushData.lineargradient.StartColor,
data->BrushData.lineargradient.EndColor, data->BrushData.lineargradient.WrapMode, &gradient);
status = GdipCreateLineBrushFromRect(&rect, data->BrushData.lineargradient.StartColor,
data->BrushData.lineargradient.EndColor, LinearGradientModeHorizontal,
data->BrushData.lineargradient.WrapMode, &gradient);
if (status == Ok)
{
if (transform)
......
......@@ -3377,7 +3377,7 @@ static void test_lineargradient(void)
stat = GdipBitmapGetPixel(bitmap, 18, 10, &color);
expect(Ok, stat);
todo_wine expect(0xff990066, color);
expect(0xff990066, color);
/* Verify vertical gradient fill. */
stat = GdipBitmapGetPixel(bitmap, 50, 10, &color);
......@@ -3395,7 +3395,7 @@ static void test_lineargradient(void)
stat = GdipBitmapGetPixel(bitmap, 18, 50, &color);
expect(Ok, stat);
todo_wine expect(0xff4700b8, color);
expect(0xff4700b8, color);
/* Verify preset color gradient fill. */
stat = GdipBitmapGetPixel(bitmap, 50, 50, &color);
......
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