added arrow tips (WIP)

This commit is contained in:
Louis Heredero 2024-06-21 02:25:30 +02:00
parent 6e7dc9913f
commit 6500e5a4a3
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7

View File

@ -2,12 +2,30 @@
#import "consts.typ": *
#import "participant.typ"
#let get-arrow-marks(sym, color) = {
if type(sym) == array {
return sym.map(s => get-arrow-marks(s, color))
}
(
"": none,
">": (symbol: ">", fill: color),
">>": (symbol: "straight"),
"\\": (symbol: ">", fill: color, harpoon: true, flip: true),
"\\\\": (symbol: "straight", harpoon: true, flip: true),
"/": (symbol: ">", fill: color, harpoon: true),
"//": (symbol: "straight", harpoon: true),
"x": none,
"o": (symbol: "o"),
).at(sym)
}
#let _seq(
p1,
p2,
comment: none,
dashed: false,
tip: "default",
start-tip: "",
end-tip: ">",
color: black,
flip: false,
enable-dst: false,
@ -24,7 +42,8 @@
p2: p2,
comment: comment,
dashed: dashed,
tip: tip,
start-tip: start-tip,
end-tip: end-tip,
color: color,
flip: flip,
enable-dst: enable-dst,
@ -119,7 +138,10 @@
}
let style = (
mark: (end: ">", fill: elmt.color),
mark: (
start: get-arrow-marks(elmt.start-tip, elmt.color),
end: get-arrow-marks(elmt.end-tip, elmt.color)
),
stroke: (
dash: if elmt.dashed {"dashed"} else {"solid"},
paint: elmt.color