From 777de3d5b089f5689104dcca1e7ca815d4b76659 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Mon, 28 Jul 2025 22:34:30 +0200 Subject: [PATCH] removed some constants --- src/core/draw/note.typ | 14 ++++++++------ src/core/draw/sequence.typ | 2 +- src/core/renderer.typ | 8 +++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/core/draw/note.typ b/src/core/draw/note.typ index 1ee656a..baada2b 100644 --- a/src/core/draw/note.typ +++ b/src/core/draw/note.typ @@ -42,9 +42,9 @@ #let get-size(note) = { let style = note.resolved-style let PAD = if style.shape == "hex" {NOTE-HEX-PAD} else {NOTE-PAD} - let m = measure(box(note.content)) - let w = m.width / 1pt + PAD.last() * 2 - let h = m.height / 1pt + PAD.first() * 2 + let m = normalize-measure(box(note.content)) + let w = m.width + PAD.last() * 2 + let h = m.height + PAD.first() * 2 if style.shape == "default" { w += NOTE-CORNER-SIZE } @@ -90,9 +90,11 @@ #let render(note, y: auto, forced: false) = { if not note.linked { if not note.aligned { - set-ctx(c => { - c.y -= Y-SPACE - return c + get-ctx(ctx => { + set-ctx(c => { + c.y -= ctx.style.y-space + return c + }) }) } } else if not forced { diff --git a/src/core/draw/sequence.typ b/src/core/draw/sequence.typ index 575fbbf..b753c38 100644 --- a/src/core/draw/sequence.typ +++ b/src/core/draw/sequence.typ @@ -49,7 +49,7 @@ #let is-cross-tip = is-tip-of-type.with("x") #let render(seq) = get-ctx(ctx => { - ctx.y -= Y-SPACE + ctx.y -= ctx.style.y-space let i1 = ctx.pars-i.at(seq.p1) let i2 = ctx.pars-i.at(seq.p2) diff --git a/src/core/renderer.typ b/src/core/renderer.typ index 09dcd64..3a72091 100644 --- a/src/core/renderer.typ +++ b/src/core/renderer.typ @@ -422,9 +422,11 @@ } } - set-ctx(ctx => { - ctx.y -= Y-SPACE - return ctx + get-ctx(ctx => { + set-ctx(c => { + c.y -= ctx.style.y-space + return c + }) }) draw.on-layer(-1, {