Skip to content

Commit

Permalink
Allow relative width in fit-to-width
Browse files Browse the repository at this point in the history
  • Loading branch information
ntjess committed Sep 2, 2023
1 parent 1860c27 commit 8e78b99
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/utils.typ
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@
style(styles => {
let content-size = measure(content, styles)
let content-width = content-size.width
// Convert percent/em into concrete units
let width = measure(h(width), styles).width
if width < content-width {
let ratio = width / content-width * 100%
// The first box keeps content from prematurely wrapping
Expand Down

0 comments on commit 8e78b99

Please sign in to comment.