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

This commit is contained in:
Vincent Povirk 2012-02-20 15:02:39 -06:00 committed by Alexandre Julliard
parent 116665d7fc
commit 1515a4b89c
1 changed files with 6 additions and 2 deletions

View File

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