-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
When drawing a line between two circles, the endpoints are automatically chosen on the circles' perimeters.
However, if a circle is in a group and we try to draw a line from outside the group, it starts/ends at the center point.
For example:
#import "@preview/cetz:0.4.2": canvas, draw
#canvas({
let ok = green + 2pt
let nope = red + 2pt
draw.circle((0, 0), name: "out1")
draw.circle((4, 0), name: "out2")
draw.line("out1", "out2", stroke: ok) // outside to outside: OK
draw.group(name: "grp", {
draw.circle((0, -3), name: "in1")
draw.circle((4, -3), name: "in2")
draw.line("out1", "in2", stroke: ok) // outside to inside (from inside): OK
draw.line("in1", "in2", stroke: ok) // inside to inside: OK
})
draw.line("out1", "grp.in1", stroke: nope) // outside to inside (from outside): Nope
})
This also happens when drawing a line between two elements inside a group from without the group:
#canvas({
draw.group(name: "grp", {
draw.circle((0, 0), name: "a")
draw.circle((4, 0), name: "b")
})
draw.line("grp.a", "grp.b")
})
Metadata
Metadata
Assignees
Labels
No labels