Compare commits
No commits in common. "49db07b9ee1b76066ebc5805d458e7b3f8f42ac1" and "99b90377196d23918b75d7635a7d87f129d2040c" have entirely different histories.
49db07b9ee
...
99b9037719
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,10 +0,0 @@
|
|||||||
# 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/)
|
|
@ -489,35 +489,31 @@
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
if config.full-page {
|
layout(size => {
|
||||||
cnvs
|
let m = measure(cnvs)
|
||||||
} else {
|
let w = m.width
|
||||||
layout(size => {
|
let h = m.height
|
||||||
let m = measure(cnvs)
|
let base-w = if type(width) == ratio {
|
||||||
let w = m.width
|
size.width * width
|
||||||
let h = m.height
|
} else {
|
||||||
let base-w = if type(width) == ratio {
|
width
|
||||||
size.width * width
|
}
|
||||||
} else {
|
let r = if w == 0 {
|
||||||
width
|
0
|
||||||
}
|
} else {
|
||||||
let r = if w == 0 {
|
base-w / w
|
||||||
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) = {
|
||||||
|
Loading…
Reference in New Issue
Block a user