Add CGContextSetAlpha
This commit is contained in:
committed by
Jeff Muizelaar
parent
0c69dc41e3
commit
3213c3e3f3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user