diff --git a/src/draw/shapes.typ b/src/draw/shapes.typ index 93ac0bdd..fd483bfa 100644 --- a/src/draw/shapes.typ +++ b/src/draw/shapes.typ @@ -73,7 +73,7 @@ border-anchors: true, path-anchors: true, center: (cx, cy, cz), - radii: (rx, ry), + radii: (rx*2, ry*2), path: drawables.first(), ) @@ -147,7 +147,7 @@ border-anchors: true, path-anchors: true, center: center, - radii: (r, r), + radii: (r*2, r*2), path: drawables.first(), ) diff --git a/tests/anchor/path-anchors/ref.png b/tests/anchor/path-anchors/ref.png index c578f439..751149c4 100644 Binary files a/tests/anchor/path-anchors/ref.png and b/tests/anchor/path-anchors/ref.png differ diff --git a/tests/anchor/path-anchors/test.typ b/tests/anchor/path-anchors/test.typ index ded66000..c15f8ff6 100644 --- a/tests/anchor/path-anchors/test.typ +++ b/tests/anchor/path-anchors/test.typ @@ -1,7 +1,7 @@ #set page(width: auto, height: auto) #import "/src/lib.typ": * -#let display(body, ..args) = { +#let display(body, ..args, angle: false) = { import draw: * // Fixed distance @@ -16,6 +16,15 @@ for i in (0%, 25%, 50%, 75%, 100%) { circle((name: "elem", anchor: i), radius: .1) } + + if angle { + set-origin((3,0)) + + (body)(..args, name: "elem"); + for i in (0deg, 45deg, 90deg, 170deg, 180deg) { + circle((name: "elem", anchor: i), radius: .1) + } + } } #box(stroke: 2pt + red, canvas(length: 1cm, { @@ -25,12 +34,12 @@ #box(stroke: 2pt + red, canvas(length: 1cm, { import draw: * - display(circle, (0,0)) + display(circle, (0,0), angle: true) })) #box(stroke: 2pt + red, canvas(length: 1cm, { import draw: * - display(circle-through, (-1,0), (0,1), (1,0)) + display(circle-through, (-1,0), (0,1), (1,0), angle: true) })) #box(stroke: 2pt + red, canvas(length: 1cm, { @@ -62,7 +71,7 @@ #box(stroke: 2pt + red, canvas(length: 1cm, { import draw: * - display(rect, (-1,-1), (1,1)) + display(rect, (-1,-1), (1,1), angle: true) })) #box(stroke: 2pt + red, canvas(length: 1cm, { @@ -95,7 +104,7 @@ display(group, { circle((0,0), radius: .5) circle((1,1), radius: .7) - }) + }, angle: true) })) #box(stroke: 2pt + red, canvas(length: 1cm, {