summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/geom/stroke.rs4
-rw-r--r--tests/typ/visualize/shape-rect.typ2
2 files changed, 5 insertions, 1 deletions
diff --git a/crates/typst/src/geom/stroke.rs b/crates/typst/src/geom/stroke.rs
index e88d887d..5fb64c90 100644
--- a/crates/typst/src/geom/stroke.rs
+++ b/crates/typst/src/geom/stroke.rs
@@ -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)
diff --git a/tests/typ/visualize/shape-rect.typ b/tests/typ/visualize/shape-rect.typ
index 98450c80..6447b55d 100644
--- a/tests/typ/visualize/shape-rect.typ
+++ b/tests/typ/visualize/shape-rect.typ
@@ -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))
---