mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Add missing gradient to stroke cast (#2527)
This commit is contained in:
parent
995fc40363
commit
64d3fd8a3f
@ -262,6 +262,10 @@ cast! {
|
|||||||
paint: Smart::Custom(color.into()),
|
paint: Smart::Custom(color.into()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|
gradient: Gradient => Self {
|
||||||
|
paint: Smart::Custom(gradient.into()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
mut dict: Dict => {
|
mut dict: Dict => {
|
||||||
fn take<T: FromValue>(dict: &mut Dict, key: &str) -> StrResult<Smart<T>> {
|
fn take<T: FromValue>(dict: &mut Dict, key: &str) -> StrResult<Smart<T>> {
|
||||||
Ok(dict.take(key).ok().map(T::from_value)
|
Ok(dict.take(key).ok().map(T::from_value)
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
#rect(radius: (left: 10pt, cake: 5pt))
|
#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))
|
#rect(stroke: (1, 2))
|
||||||
|
|
||||||
---
|
---
|
||||||
|
Loading…
x
Reference in New Issue
Block a user