Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd CGContextSetShadow and CGContextSetShadowWithColor to CGContext #368
Conversation
| @@ -705,5 +717,8 @@ extern { | |||
|
|
|||
| fn CGContextDrawLinearGradient(c: ::sys::CGContextRef, gradient: ::sys::CGGradientRef, startPoint: CGPoint, endPoint: CGPoint, options: CGGradientDrawingOptions); | |||
| fn CGContextDrawRadialGradient(c: ::sys::CGContextRef, gradient: ::sys::CGGradientRef, startCenter: CGPoint, startRadius: CGFloat, endCenter:CGPoint, endRadius:CGFloat, options: CGGradientDrawingOptions); | |||
|
|
|||
| fn CGContextSetShadow(c: ::sys::CGContextRef, offset: CGSize, blur: CGFloat); | |||
| fn CGContextSetShadowWithColor(c: ::sys::CGContextRef, offset: CGSize, blur: CGFloat, color: *const c_void); | |||
This comment has been minimized.
This comment has been minimized.
jdm
Apr 13, 2020
Member
Why the void*? https://developer.apple.com/documentation/coregraphics/1455205-cgcontextsetshadowwithcolor says it should be a CGColorRef.
This comment has been minimized.
This comment has been minimized.
brunogouveia
Apr 13, 2020
Author
Contributor
I think I declared in the same way CGContextSetFillColorWithColor was declared, but we can change the color type to ::sys::CGColorRef and import TCFType trait.
Btw, for future reference, why some types were defined with foreign_type whilst others were defined with declare_TCFType?
This comment has been minimized.
This comment has been minimized.
jdm
Apr 13, 2020
Member
I think we started using foreign_type on an ad-hoc basis at some point, and only in some repositories before merging them into this one? In any case, if it builds, foreign_type is usually preferred now.
|
@bors-servo r+ |
|
|
|
|
brunogouveia commentedApr 13, 2020
No description provided.