cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
825 stars 35 forks source link

misaligned circle content positions when using circle-through #300

Closed AdiWeit closed 10 months ago

AdiWeit commented 10 months ago

When writing

cetz.canvas({

import cetz.draw: * import cetz.angle: angle circle-through((0, 0), (6, 0), (4, 3), stroke: red, name: "circ") circle("circ.center", radius: 4, stroke: blue, name: "circ2") // points of the circle circle((0, 0), radius: .07) circle((6, 0), radius: .07) circle((4, 3), radius: .07) // drawing content of the cricle for point in ("top-left", "top-right", "top", "right", "left", "bottom-left", "bottom-right", "bottom", "center") { content("circ."+point, "1") content("circ2."+point, "2") } }) the content of the blue circle created using circle(...) is positioned just fine, but when using circle-through(...) (the red circle) it positions the content way too far towards the middle or am I missing something? grafik

fenjalien commented 10 months ago

This will be fixed in 0.2 but it is caused by circle-through calculating its anchors with the wrong radius. It'll be affected by the radius style key.