From fe4b88e53c22f984fa72a50bbd3f4b06e1f7964c Mon Sep 17 00:00:00 2001 From: Eric Biedert Date: Sun, 20 Oct 2024 17:15:24 +0200 Subject: [PATCH] Fix division by zero --- src/droplet.typ | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/droplet.typ b/src/droplet.typ index d3afa64..6b8c9be 100644 --- a/src/droplet.typ +++ b/src/droplet.typ @@ -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) }