minor style improvements

This commit is contained in:
Louis Heredero 2024-06-21 18:14:40 +02:00
parent 0cff9d6799
commit 2c724598e9
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7
9 changed files with 35 additions and 7 deletions

16
gallery.bash Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
echo
echo "Generating gallery PDFs"
set -- ./gallery/*.typ
cnt="$#"
i=1
for f
do
f2="${f/typ/pdf}"
echo "($i/$cnt) $f -> $f2"
typst c --root ./ "$f" "$f2"
i=$((i+1))
done

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,6 +2,7 @@
#let PAR-SPACE = 10 #let PAR-SPACE = 10
#let COMMENT-PAD = 8 #let COMMENT-PAD = 8
#let LIFELINE-W = 10 #let LIFELINE-W = 10
#let CREATE-OFFSET = 15
#let SYM-GAP = 5 #let SYM-GAP = 5
#let PAR-PAD = (5pt, 3pt) #let PAR-PAD = (5pt, 3pt)

View File

@ -44,7 +44,7 @@
if group.desc != none { if group.desc != none {
shapes += draw.content( shapes += draw.content(
(x0 + w, y0), (x0 + w, y0),
text([\[#group.desc\]], weight: "bold"), text([\[#group.desc\]], weight: "bold", size: .8em),
anchor: "north-west", anchor: "north-west",
padding: 3pt padding: 3pt
) )

View File

@ -340,7 +340,11 @@
draw.line( draw.line(
(x, last-y), (x, last-y),
(x, line.at(1)), (x, line.at(1)),
stroke: (dash: "dashed", paint: gray.darken(40%)) stroke: (
dash: "dashed",
paint: gray.darken(40%),
thickness: .5pt
)
) )
} }
lines.push(line) lines.push(line)
@ -368,7 +372,11 @@
draw.line( draw.line(
(x, last-y), (x, last-y),
(x, y), (x, y),
stroke: (dash: "dashed", paint: gray.darken(40%)) stroke: (
dash: "dashed",
paint: gray.darken(40%),
thickness: .5pt
)
) )
// Draw lifeline rectangles (reverse for bottom to top) // Draw lifeline rectangles (reverse for bottom to top)

View File

@ -120,7 +120,7 @@
let m = measure(box(par.display-name)) let m = measure(box(par.display-name))
let f = if i1 > i2 {-1} else {1} let f = if i1 > i2 {-1} else {1}
end-info.x -= (m.width + PAR-PAD.last() * 2) / 2pt * f end-info.x -= (m.width + PAR-PAD.last() * 2) / 2pt * f
shapes += participant.render(x-pos, par, y: y) shapes += participant.render(x-pos, par, y: y - CREATE-OFFSET)
} }
end-info.ll-lvl = lifelines.at(i2).level * LIFELINE-W / 2 end-info.ll-lvl = lifelines.at(i2).level * LIFELINE-W / 2
@ -146,11 +146,13 @@
let style = ( let style = (
mark: ( mark: (
start: get-arrow-marks(elmt.start-tip, elmt.color), start: get-arrow-marks(elmt.start-tip, elmt.color),
end: get-arrow-marks(elmt.end-tip, elmt.color) end: get-arrow-marks(elmt.end-tip, elmt.color),
scale: 1.2
), ),
stroke: ( stroke: (
dash: if elmt.dashed {"dashed"} else {"solid"}, dash: if elmt.dashed {(2pt,2pt)} else {"solid"},
paint: elmt.color paint: elmt.color,
thickness: .5pt
) )
) )
@ -217,6 +219,7 @@
lifelines.at(i2) = dst-line lifelines.at(i2) = dst-line
} }
if elmt.create-dst { if elmt.create-dst {
y -= CREATE-OFFSET
let dst-line = lifelines.at(i2) let dst-line = lifelines.at(i2)
dst-line.lines.push(("create", y)) dst-line.lines.push(("create", y))
lifelines.at(i2) = dst-line lifelines.at(i2) = dst-line