Fix group overflows #19
@@ -1,8 +1,8 @@
|
|||||||
#import "/src/cetz.typ": draw, vector
|
#import "/src/cetz.typ": draw, vector, coordinate
|
||||||
|
|
||||||
#import "note.typ"
|
#import "note.typ"
|
||||||
#import "/src/consts.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) = {
|
#let get-arrow-marks(sym, color) = {
|
||||||
if sym == none {
|
if sym == none {
|
||||||
@@ -223,6 +223,11 @@
|
|||||||
).at(seq.comment-align)
|
).at(seq.comment-align)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expand-parent-group(
|
||||||
|
calc.min(x1, x2, x-mid),
|
||||||
|
calc.max(x1, x2, x-mid)
|
||||||
|
)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
pts = (
|
pts = (
|
||||||
(x1, start-info.y),
|
(x1, start-info.y),
|
||||||
@@ -261,6 +266,11 @@
|
|||||||
(p1, p2) = (p2, p1)
|
(p1, p2) = (p2, p1)
|
||||||
}
|
}
|
||||||
comment-angle = vector.angle2(p1, p2)
|
comment-angle = vector.angle2(p1, p2)
|
||||||
|
|
||||||
|
expand-parent-group(
|
||||||
|
calc.min(x1, x2),
|
||||||
|
calc.max(x1, x2)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start circle tip
|
// Start circle tip
|
||||||
@@ -335,8 +345,23 @@
|
|||||||
comment,
|
comment,
|
||||||
anchor: comment-anchor,
|
anchor: comment-anchor,
|
||||||
angle: comment-angle,
|
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 {
|
if seq.create-dst {
|
||||||
|
Reference in New Issue
Block a user