From 57c82a89c77edcc0d6d05e25c8c40d32f677fbbb Mon Sep 17 00:00:00 2001 From: Cameron White Date: Sun, 23 Dec 2012 14:10:51 -0500 Subject: [PATCH] cairo: Fix rectangles returned by StrokeExtents and FillExtents methods 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 --- cairo/Context.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cairo/Context.cs b/cairo/Context.cs index ced669ce7..1b8bc9e1e 100644 --- a/cairo/Context.cs +++ b/cairo/Context.cs @@ -578,7 +578,7 @@ namespace Cairo { { double x1, y1, x2, y2; NativeMethods.cairo_stroke_extents (state, 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 () @@ -590,7 +590,7 @@ namespace Cairo { { double x1, y1, x2, y2; NativeMethods.cairo_fill_extents (state, 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 ()