Evan Stade : gdiplus: Use passed pen in GdipAddPathWorldBound.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jul 13 08:30:15 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Thu Jul 12 19:42:54 2007 -0700

gdiplus: Use passed pen in GdipAddPathWorldBound.

---

 dlls/gdiplus/graphicspath.c       |   13 +++++++++----
 dlls/gdiplus/tests/graphicspath.c |   13 +++++--------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index 5b410d6..72b718a 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -217,6 +217,7 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds,
     GpPointF extrema[2];
     GpPointF * points;
     INT count, i;
+    REAL path_width;
 
     /* Matrix and pen can be null. */
     if(!path || !bounds)
@@ -229,10 +230,6 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds,
         return Ok;
     }
 
-    /* FIXME: implement case where pen is non-NULL. */
-    if(pen)
-        return NotImplemented;
-
     points = path->pathdata.Points;
     extrema[0].X = extrema[1].X  = points[0].X;
     extrema[0].Y = extrema[1].Y = points[0].Y;
@@ -249,6 +246,14 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds,
         GdipTransformMatrixPoints((GpMatrix*)matrix, extrema, 2);
     }
 
+    if(pen){
+        path_width = pen->width * pen->miterlimit / 2.0;
+        extrema[0].X -= path_width;
+        extrema[0].Y -= path_width;
+        extrema[1].X += path_width;
+        extrema[1].Y += path_width;
+    }
+
     bounds->X = extrema[0].X;
     bounds->Y = extrema[0].Y;
     bounds->Width = extrema[1].X - extrema[0].X;
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c
index 6754797..63c0bdc 100644
--- a/dlls/gdiplus/tests/graphicspath.c
+++ b/dlls/gdiplus/tests/graphicspath.c
@@ -301,16 +301,13 @@ static void test_worldbounds(void)
     GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 0.0, 100.0);
     GdipAddPathLine2(path, &(line2_points[0]), 10);
     status = GdipGetPathWorldBounds(path, &bounds, NULL, pen);
-    todo_wine
-        expect(Ok, status);
+    expect(Ok, status);
     GdipDeletePath(path);
 
-    todo_wine{
-        expectf(100.0, bounds.X);
-        expectf(100.0, bounds.Y);
-        expectf(650.0, bounds.Width);
-        expectf(800.0, bounds.Height);
-    }
+    expectf(100.0, bounds.X);
+    expectf(100.0, bounds.Y);
+    expectf(650.0, bounds.Width);
+    expectf(800.0, bounds.Height);
 }
 
 START_TEST(graphicspath)




More information about the wine-cvs mailing list