Add CGContextSetAlpha

This commit is contained in:
Hein Rutjes
2022-10-06 11:23:19 +02:00
committed by Jeff Muizelaar
parent 0c69dc41e3
commit 3213c3e3f3
+8
View File
@@ -612,6 +612,12 @@ impl CGContextRef {
CGContextSetShadowWithColor(self.as_ptr(), offset, blur, color.as_concrete_TypeRef());
}
}
pub fn set_alpha(&self, alpha: CGFloat) {
unsafe {
CGContextSetAlpha(self.as_ptr(), alpha);
}
}
}
#[test]
@@ -771,5 +777,7 @@ extern {
fn CGContextSetShadow(c: ::sys::CGContextRef, offset: CGSize, blur: CGFloat);
fn CGContextSetShadowWithColor(c: ::sys::CGContextRef, offset: CGSize, blur: CGFloat, color: ::sys::CGColorRef);
fn CGContextSetAlpha(c: ::sys::CGContextRef, alpha: CGFloat);
}