added allow-overlap parameter for notes
This commit is contained in:
		| @@ -82,12 +82,12 @@ | ||||
|   let (p1, p2) = (none, none) | ||||
|   let cell = none | ||||
|   if note.side == "left" { | ||||
|     p1 = "[" | ||||
|     p1 = note.pos2 | ||||
|     p2 = note.pos | ||||
|     cell = get-note-box(note) | ||||
|   } else if note.side == "right" { | ||||
|     p1 = note.pos | ||||
|     p2 = "]" | ||||
|     p2 = note.pos2 | ||||
|     cell = get-note-box(note) | ||||
|   } else if note.side == "over" and note.aligned-with != none { | ||||
|     let box1 = get-note-box(note) | ||||
|   | ||||
| @@ -126,8 +126,8 @@ | ||||
|     "linked", | ||||
|     note.pos == none and note.side != "across" | ||||
|   ) | ||||
|   let names = ctx.participants.map(p => p.name) | ||||
|   if note.pos == none and note.side != "across" { | ||||
|     let names = ctx.participants.map(p => p.name) | ||||
|     let i1 = names.position(n => n == ctx.last-seq.p1) | ||||
|     let i2 = names.position(n => n == ctx.last-seq.p2) | ||||
|     let pars = ( | ||||
| @@ -150,10 +150,26 @@ | ||||
|     n.aligned-with = note | ||||
|     ctx.elmts.at(ctx.last-note.i) = n | ||||
|   } | ||||
|   if note.side == "left" { | ||||
|     ctx.linked.push("[") | ||||
|   } else if note.side == "right" { | ||||
|     ctx.linked.push("]") | ||||
|  | ||||
|   if note.side in ("left", "right") { | ||||
|     let i = names.position(n => n == note.pos) | ||||
|     let pos2 = note.pos | ||||
|     if note.side == "left" { | ||||
|       if i <= 0 or note.allow-overlap { | ||||
|         ctx.linked.push("[") | ||||
|         pos2 = "[" | ||||
|       } else { | ||||
|         pos2 = names.at(i - 1) | ||||
|       } | ||||
|     } else if note.side == "right" { | ||||
|       if i >= names.len() - 1 or note.allow-overlap { | ||||
|         ctx.linked.push("]") | ||||
|         pos2 = "]" | ||||
|       } else { | ||||
|         pos2 = names.at(i + 1) | ||||
|       } | ||||
|     } | ||||
|     note.insert("pos2", pos2) | ||||
|   } | ||||
|  | ||||
|   let pars = none | ||||
|   | ||||
		Reference in New Issue
	
	Block a user