Vincent Povirk : gdiplus: Set path gradient center points based on the path 's bounding rect.

Alexandre Julliard julliard at winehq.org
Tue Mar 13 13:50:35 CDT 2012


Module: wine
Branch: master
Commit: 1515a4b89cb078b2ad0545643ed0530a7fe4b7e0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1515a4b89cb078b2ad0545643ed0530a7fe4b7e0

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Mon Feb 20 15:02:39 2012 -0600

gdiplus: Set path gradient center points based on the path's bounding rect.

---

 dlls/gdiplus/brush.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index c601c10..48dd14d 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -484,9 +484,13 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI(GDIPCONST GpRect* rect
 
 static GpStatus create_path_gradient(GpPath *path, GpPathGradient **grad)
 {
+    GpRectF bounds;
+
     if(!path || !grad)
         return InvalidParameter;
 
+    GdipGetPathWorldBounds(path, &bounds, NULL, NULL);
+
     *grad = GdipAlloc(sizeof(GpPathGradient));
     if (!*grad)
     {
@@ -513,8 +517,8 @@ static GpStatus create_path_gradient(GpPath *path, GpPathGradient **grad)
     (*grad)->wrap = WrapModeClamp;
     (*grad)->gamma = FALSE;
     /* FIXME: this should be set to the "centroid" of the path by default */
-    (*grad)->center.X = 0.0;
-    (*grad)->center.Y = 0.0;
+    (*grad)->center.X = bounds.X + bounds.Width / 2;
+    (*grad)->center.Y = bounds.Y + bounds.Height / 2;
     (*grad)->focus.X = 0.0;
     (*grad)->focus.Y = 0.0;
 




More information about the wine-cvs mailing list