Skip to content

Commit

Permalink
Fix division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicEricEE committed Oct 20, 2024
1 parent dd64654 commit fe4b88e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/droplet.typ
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
// Returns: The text with the adjusted size.
#let sized(height, ..text-args, body) = context {
let styled-text = text.with(..text-args.named(), body)
let factor = height / measure(styled-text(1em)).height
let measured = measure(styled-text(1em)).height
let factor = if measured > 0pt { height / measured } else { 1 }
styled-text(factor * 1em)
}

Expand Down

0 comments on commit fe4b88e

Please sign in to comment.