From 2d5186ac1b17784564481cb08691d4c36c9bc3e0 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 7 May 2009 11:33:28 -0500 Subject: [PATCH] gdiplus: store the rectangle in line gradient brushes --- dlls/gdiplus/brush.c | 11 ++++++----- dlls/gdiplus/gdiplus_private.h | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 60d5970..7372ec0 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -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; } diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index e038baf..f3bf797 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -143,6 +143,7 @@ struct GpLineGradient{ GpPointF endpoint; ARGB startcolor; ARGB endcolor; + RectF rect; GpWrapMode wrap; BOOL gamma; REAL* blendfac; /* blend factors */ -- 1.5.4.3