Skip to content

Commit

Permalink
use fields for stroke thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Dec 31, 2023
1 parent 4d7e168 commit 2f63a09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utilities.typ
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@
} else if is-color(stroke) {
1pt
} else if type(stroke) == _stroke-type {
if typst-fields-supported {
// No need for any repr() parsing, just use the thickness field.
let thickness = default-if-auto(stroke.thickness, 1pt)
return convert-length-to-pt(thickness, styles: styles)
}

// support:
// - 2pt / 2em / 2cm / 2in + color
// - 2.5pt / 2.5em / ... + color
Expand Down

0 comments on commit 2f63a09

Please sign in to comment.