[4/5] gdiplus: Set path gradient center points based on the path's bounding rect.

Vincent Povirk madewokherd at gmail.com
Mon Mar 12 16:02:16 CDT 2012


-------------- next part --------------
From abc411d1abe5ec6ef610937d9d565581a5b3e800 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Mon, 20 Feb 2012 15:02:39 -0600
Subject: [PATCH 04/14] gdiplus: Set path gradient center points based on the
 path's bounding rect.

This is still wrong, but at least it's more likely to give us a point that's
inside the path.
---
 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 21bec64..692f2d0 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -490,9 +490,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)
     {
@@ -519,8 +523,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;
 
-- 
1.7.9


More information about the wine-patches mailing list