From a5384658d59a3f2d99e6e431b2d35036dee7eeaa Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Wed, 10 Apr 2019 09:37:44 -0400 Subject: [PATCH] Expose support for clipping to the current path --- core-graphics/src/context.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core-graphics/src/context.rs b/core-graphics/src/context.rs index 15699e0..518e960 100644 --- a/core-graphics/src/context.rs +++ b/core-graphics/src/context.rs @@ -327,6 +327,18 @@ impl CGContextRef { } } + pub fn clip(&self) { + unsafe { + CGContextClip(self.as_ptr()); + } + } + + pub fn eo_clip(&self) { + unsafe { + CGContextEOClip(self.as_ptr()); + } + } + pub fn fill_path(&self) { unsafe { CGContextFillPath(self.as_ptr()); @@ -508,6 +520,8 @@ extern { y: CGFloat); fn CGContextFillPath(c: ::sys::CGContextRef); fn CGContextEOFillPath(c: ::sys::CGContextRef); + fn CGContextClip(c: ::sys::CGContextRef); + fn CGContextEOClip(c: ::sys::CGContextRef); fn CGContextStrokePath(c: ::sys::CGContextRef); fn CGContextSetRGBFillColor(context: ::sys::CGContextRef, red: CGFloat,