Signed-off-by: Shawn M. Chapla schapla@codeweavers.com --- dlls/gdiplus/metafile.c | 15 ++++++++------- dlls/gdiplus/tests/metafile.c | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index 7f019749eaf..e0ff6cae7a4 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -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) diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index cdc53b39a1f..e2d5171f8a7 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -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);