MaskFilter::blur return an option to allow the parameter verfication to fail (for example if sigma is 0.0 or not finite)
@@ -25,11 +25,14 @@ impl NativeFlattenable for SkMaskFilter {
}
impl RCHandle<SkMaskFilter> {
- pub fn blur(style: BlurStyle, sigma: scalar, respect_ctm: impl Into<Option<bool>>) -> Self {
+ pub fn blur(
+ style: BlurStyle,
+ sigma: scalar,
+ respect_ctm: impl Into<Option<bool>>,
+ ) -> Option<Self> {
Self::from_ptr(unsafe {
sb::C_SkMaskFilter_MakeBlur(style, sigma, respect_ctm.into().unwrap_or(true))
})
- .unwrap()
}
#[deprecated(since = "0.30.0", note = "removed without replacement")]
