refactored notes

This commit is contained in:
2025-07-14 17:02:16 +02:00
parent 3a1c274e83
commit b1ad3b98d2
5 changed files with 183 additions and 176 deletions

View File

@ -8,7 +8,7 @@
#import "../separator.typ"
#import "../sync.typ"
#import "../consts.typ": *
#import "../note.typ" as note: get-note-box
#import "draw/note.typ": get-box as get-note-box, get-size as get-note-size
#let DEBUG-INVISIBLE = false
@ -83,7 +83,7 @@
return participants
}
#let note-get-cell(note) = {
#let note-get-cell(pars-i, note) = {
let (p1, p2) = (none, none)
let cell = none
if note.side == "left" {
@ -140,7 +140,7 @@
)
} else if elmt.type == "note" {
let cell = note-get-cell(elmt)
let cell = note-get-cell(pars-i, elmt)
if cell != none {
cells.push(cell)
}
@ -172,7 +172,7 @@
for n in notes.filter(e => (e.side == "over" and
type(e.pos) == str)) {
let m = note.get-size(n)
let m = get-note-size(n)
let i = pars-i.at(n.pos)
if i < widths.len() {
@ -356,16 +356,6 @@
#let render(participants, elements) = context canvas(length: 1pt, {
let shapes = ()
setup-ctx(participants, elements)
/*
let draw-seq = sequence.render.with(pars-i, x-pos, participants)
let draw-group = group.render.with()
let draw-else = group.render-else.with()
let draw-sep = separator.render.with(x-pos)
//let draw-par = participant.render.with(x-pos)
let draw-note = note.render.with(pars-i, x-pos)
let draw-sync = sync.render.with(pars-i, x-pos, participants)
*/
// Draw participants (start)
get-ctx(ctx => {
@ -456,17 +446,6 @@
)
}
y = y1
// Note
} else if elmt.type == "note" {
if not elmt.linked {
if not elmt.aligned {
y -= Y-SPACE
}
let shps
(y, shps) = draw-note(elmt, y, lifelines)
shapes += shps
}
}
}