From b33208f71693255ab4dae63f45dbc7c65d82480e Mon Sep 17 00:00:00 2001 From: Cameron White Date: Wed, 15 Jul 2020 16:46:14 -0400 Subject: [PATCH] Implement Cairo.Context.PathExtents() This exposes the cairo_path_extents() method, and is closely related to the existing StrokeExtents() method. --- Source/Libs/CairoSharp/Context.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Libs/CairoSharp/Context.cs b/Source/Libs/CairoSharp/Context.cs index 6efd21879..09de92921 100644 --- a/Source/Libs/CairoSharp/Context.cs +++ b/Source/Libs/CairoSharp/Context.cs @@ -545,6 +545,14 @@ namespace Cairo { NativeMethods.cairo_append_path (handle, path.Handle); } + public Rectangle PathExtents () + { + CheckDisposed (); + double x1, y1, x2, y2; + NativeMethods.cairo_path_extents (handle, out x1, out y1, out x2, out y2); + return new Rectangle (x1, y1, x2 - x1, y2 - y1); + } + #endregion #region Painting Methods