Skip to content

Commit d1a7b34

Browse files
committed
Add warning for pattern
See typst#5590
1 parent 42b4d02 commit d1a7b34

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

crates/typst-library/src/visualize/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,9 @@ pub(super) fn define(global: &mut Scope) {
5252
global.define_elem::<PathElem>();
5353

5454
// Compatibility.
55-
global.define("pattern", Type::of::<Tiling>());
55+
global.define_deprecated(
56+
"pattern",
57+
Type::of::<Tiling>(),
58+
"the name `pattern` is deprecated, use `tiling` instead",
59+
);
5660
}

tests/suite/visualize/tiling.typ

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
]))
159159

160160
--- tiling-pattern-compatibility ---
161+
// Warning: 2:10-2:17 the name `pattern` is deprecated, use `tiling` instead
161162
#set page(width: auto, height: auto, margin: 0pt)
162163
#let t = pattern(size: (10pt, 10pt), line(stroke: 4pt, start: (0%, 0%), end: (100%, 100%)))
163164
#rect(width: 50pt, height: 50pt, fill: t)

0 commit comments

Comments
 (0)