Add missing gradient to stroke cast (#2527)

This commit is contained in:
Eric Biedert 2023-10-30 22:24:39 +01:00 committed by GitHub
parent 995fc40363
commit 64d3fd8a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -262,6 +262,10 @@ cast! {
paint: Smart::Custom(color.into()),
..Default::default()
},
gradient: Gradient => Self {
paint: Smart::Custom(gradient.into()),
..Default::default()
},
mut dict: Dict => {
fn take<T: FromValue>(dict: &mut Dict, key: &str) -> StrResult<Smart<T>> {
Ok(dict.take(key).ok().map(T::from_value)

View File

@ -51,7 +51,7 @@
#rect(radius: (left: 10pt, cake: 5pt))
---
// Error: 15-21 expected length, color, dictionary, stroke, none, or auto, found array
// Error: 15-21 expected length, color, gradient, dictionary, stroke, none, or auto, found array
#rect(stroke: (1, 2))
---