added auto fit wrapper function
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
#import "utils.typ": get-group-span
|
||||
#import "utils.typ": get-group-span, fit-canvas
|
||||
#import "renderer.typ": render
|
||||
#import "participant.typ" as participant: _par, PAR-SPECIALS
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
),)
|
||||
}
|
||||
|
||||
#let diagram(elements) = {
|
||||
#let diagram(elements, width: auto) = {
|
||||
if elements == none {
|
||||
return
|
||||
}
|
||||
@ -188,7 +188,8 @@
|
||||
}
|
||||
|
||||
set text(font: "Source Sans 3")
|
||||
render(participants, elmts)
|
||||
let canvas = render(participants, elmts)
|
||||
fit-canvas(canvas, width: width)
|
||||
}
|
||||
|
||||
#let from-plantuml(code) = {
|
||||
|
Reference in New Issue
Block a user