added max-width param to _col

This commit is contained in:
Louis Heredero 2024-11-09 14:42:11 +01:00
parent ab1386e721
commit b33531bef5
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7
2 changed files with 10 additions and 6 deletions

View File

@ -19,14 +19,15 @@
),)
}
#let _col(p1, p2, width: auto, margin: 0, min-width: 0) = {
#let _col(p1, p2, width: auto, margin: 0, min-width: 0, max-width: none) = {
return ((
type: "col",
p1: p1,
p2: p2,
width: width,
margin: margin,
min-width: min-width
min-width: min-width,
max-width: max-width
),)
}

View File

@ -218,10 +218,13 @@
if elmt.width != auto {
widths.at(i) = normalize-units(elmt.width)
}
widths.at(i) = calc.max(
widths.at(i),
normalize-units(elmt.min-width)
) + normalize-units(elmt.margin)
let width = widths.at(i)
width = calc.max(width, normalize-units(elmt.min-width))
if elmt.max-width != none {
width = calc.min(width, normalize-units(elmt.max-width))
}
widths.at(i) = width + normalize-units(elmt.margin)
}
}