From c19d5074866efa2bf28989336ea071108ee8f5d9 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Tue, 29 Jul 2025 00:04:24 +0200 Subject: [PATCH] fixed self-sequence overflow --- src/core/draw/sequence.typ | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/core/draw/sequence.typ b/src/core/draw/sequence.typ index 49103e6..ac26b7d 100644 --- a/src/core/draw/sequence.typ +++ b/src/core/draw/sequence.typ @@ -1,8 +1,8 @@ -#import "/src/cetz.typ": draw, vector +#import "/src/cetz.typ": draw, vector, coordinate #import "note.typ" #import "/src/consts.typ": * -#import "/src/core/utils.typ": get-ctx, set-ctx +#import "/src/core/utils.typ": get-ctx, set-ctx, expand-parent-group #let get-arrow-marks(sym, color) = { if sym == none { @@ -223,6 +223,11 @@ ).at(seq.comment-align) } + expand-parent-group( + calc.min(x1, x2, x-mid), + calc.max(x1, x2, x-mid) + ) + } else { pts = ( (x1, start-info.y), @@ -261,6 +266,11 @@ (p1, p2) = (p2, p1) } comment-angle = vector.angle2(p1, p2) + + expand-parent-group( + calc.min(x1, x2), + calc.max(x1, x2) + ) } // Start circle tip @@ -335,8 +345,23 @@ comment, anchor: comment-anchor, angle: comment-angle, - padding: 3pt + padding: 3pt, + name: "comment" ) + + // TODO: Improve this + draw.get-ctx(c => { + let (_, left, right) = coordinate.resolve( + c, + "comment.west", + "comment.east" + ) + expand-parent-group( + left.at(0), + right.at(0) + ) + }) + } if seq.create-dst {