From 128f022a47484912a3ca55c329a0d05427b613bb Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 4 Jan 2019 09:56:43 -0500 Subject: [PATCH] Add a binding for CGContextGetClipBoundingBox --- core-graphics/src/context.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core-graphics/src/context.rs b/core-graphics/src/context.rs index 363c11b..3ab0c48 100644 --- a/core-graphics/src/context.rs +++ b/core-graphics/src/context.rs @@ -154,6 +154,12 @@ impl CGContextRef { } } + pub fn clip_bounding_box(&self) -> CGRect { + unsafe { + CGContextGetClipBoundingBox(self.as_ptr()) + } + } + pub fn set_fill_color(&self, color: &CGColor) { unsafe { CGContextSetFillColorWithColor(self.as_ptr(), color.to_void()); @@ -412,6 +418,7 @@ extern { fn CGBitmapContextGetBytesPerRow(context: ::sys::CGContextRef) -> size_t; fn CGBitmapContextCreateImage(context: ::sys::CGContextRef) -> ::sys::CGImageRef; fn CGContextGetTypeID() -> CFTypeID; + fn CGContextGetClipBoundingBox(c: ::sys::CGContextRef) -> CGRect; fn CGContextFlush(c: ::sys::CGContextRef); fn CGContextSetBlendMode(c: ::sys::CGContextRef, blendMode: CGBlendMode); fn CGContextSetAllowsFontSmoothing(c: ::sys::CGContextRef, allowsFontSmoothing: bool);