diff --git a/src/sequence.typ b/src/sequence.typ index b5809fb..23dd557 100644 --- a/src/sequence.typ +++ b/src/sequence.typ @@ -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