Mono.Cairo: Fix rectangles returned by StrokeExtents and FillExtents
authorCameron White <cameronwhite91@gmail.com>
Sun, 23 Dec 2012 19:10:51 +0000 (14:10 -0500)
committerMichael Hutchinson <m.j.hutchinson@gmail.com>
Wed, 19 Jun 2013 22:36:34 +0000 (18:36 -0400)
The third and fourth parameters of the Rectangle constructor are width
and height, but cairo_stroke_extents and cairo_fill_extents give right
and bottom coordinates.

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
Conflicts:
mcs/class/Mono.Cairo/Mono.Cairo/Context.cs

mcs/class/Mono.Cairo/Mono.Cairo/Context.cs

index 65a3d411b5d8575e1de24cc2bca5f8de43829100..699c079cf2df242e03356611603f8cdabcca94fa 100644 (file)
@@ -477,7 +477,7 @@ namespace Cairo {
                {
                        double x1, y1, x2, y2;
                        NativeMethods.cairo_stroke_extents (handle, out x1, out y1, out x2, out y2);
-                       return new Rectangle (x1, y1, x2, y2);
+                       return new Rectangle (x1, y1, x2 - x1, y2 - y1);
                }
 
                public void Fill ()
@@ -489,7 +489,7 @@ namespace Cairo {
                {
                        double x1, y1, x2, y2;
                        NativeMethods.cairo_fill_extents (handle, out x1, out y1, out x2, out y2);
-                       return new Rectangle (x1, y1, x2, y2);
+                       return new Rectangle (x1, y1, x2 - x1, y2 - y1);
                }
 
                public void FillPreserve ()