fixed full page diagrams

This commit is contained in:
Louis Heredero 2024-06-14 07:41:52 +02:00
parent 99b9037719
commit d75e447bf3
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7

View File

@ -489,31 +489,35 @@
) )
}) })
layout(size => { if config.full-page {
let m = measure(cnvs) cnvs
let w = m.width } else {
let h = m.height layout(size => {
let base-w = if type(width) == ratio { let m = measure(cnvs)
size.width * width let w = m.width
} else { let h = m.height
width let base-w = if type(width) == ratio {
} size.width * width
let r = if w == 0 { } else {
0 width
} else { }
base-w / w let r = if w == 0 {
} 0
} else {
base-w / w
}
let new-w = w * r let new-w = w * r
let new-h = h * r let new-h = h * r
r *= 100% r *= 100%
box( box(
width: new-w, width: new-w,
height: new-h, height: new-h,
scale(x: r, y: r, cnvs, reflow: true) scale(x: r, y: r, cnvs, reflow: true)
) )
}) })
}
} }
#let make(config) = { #let make(config) = {