From 8debb7c8249d2a149676054585b89682c2ea88ac Mon Sep 17 00:00:00 2001 From: yvt Date: Mon, 29 Apr 2019 09:23:37 +0900 Subject: [PATCH] Add `CGContext::add_quad_curve_to_point` --- core-graphics/src/context.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core-graphics/src/context.rs b/core-graphics/src/context.rs index 518e960..bf6f623 100644 --- a/core-graphics/src/context.rs +++ b/core-graphics/src/context.rs @@ -303,6 +303,18 @@ impl CGContextRef { } } + pub fn add_quad_curve_to_point(&self, + cpx: CGFloat, + cpy: CGFloat, + x: CGFloat, + y: CGFloat) { + unsafe { + CGContextAddQuadCurveToPoint(self.as_ptr(), + cpx, cpy, + x, y); + } + } + pub fn add_line_to_point(&self, x: CGFloat, y: CGFloat) { unsafe { CGContextAddLineToPoint(self.as_ptr(), x, y); @@ -510,6 +522,11 @@ extern { cp2y: CGFloat, x: CGFloat, y: CGFloat); + fn CGContextAddQuadCurveToPoint(c: ::sys::CGContextRef, + cpx: CGFloat, + cpy: CGFloat, + x: CGFloat, + y: CGFloat); fn CGContextAddLineToPoint(c: ::sys::CGContextRef, x: CGFloat, y: CGFloat);