Compare commits

..

2 Commits

Author SHA1 Message Date
49db07b9ee
added CHANGELOG.md 2024-06-14 07:42:20 +02:00
d75e447bf3
fixed full page diagrams 2024-06-14 07:41:52 +02:00
2 changed files with 37 additions and 23 deletions

10
CHANGELOG.md Normal file
View File

@ -0,0 +1,10 @@
# Changelog
## [v0.0.2] - _WIP_
### Added
- `width` parameter to `schema.render` for easier integration
- `all-bit-i` config option
## [v0.0.1] - 2024-05-19
- initial version
- ported all features from the [python package](https://git.kb28.ch/HEL/rivet/)

View File

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