Skip to content

Commit 81a9cd9

Browse files
committed
shapes: Transform content angle coordinate
Fixes #1032
1 parent 49ba120 commit 81a9cd9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/draw/shapes.typ

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,8 @@
11251125
}
11261126

11271127
let angle = if type(angle) != std.angle {
1128-
let c
1129-
(ctx, c) = coordinate.resolve(ctx, angle)
1130-
vector.angle2(a, c)
1128+
let (_, c) = coordinate.resolve(ctx, angle)
1129+
vector.angle2(a, util.apply-transform(ctx.transform, c))
11311130
} else {
11321131
angle
11331132
}

tests/content/rotation/ref/1.png

1.89 KB
Loading

tests/content/rotation/test.typ

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@
1919
content((0,0), [Content], angle: pt)
2020
})
2121
}
22+
23+
// Rotate to coordinate with transformation != id (#1032)
24+
#test-case({
25+
import draw: *
26+
27+
line((0, 0), (1, 0), name: "a")
28+
rotate(90deg)
29+
line((0, 0), (1, 0), name: "b")
30+
content((0,0), [Content], angle: "a.end")
31+
})

0 commit comments

Comments
 (0)