Support orient/rotate towards other points

This commit is contained in:
Bán Dénes 2022-02-27 13:44:24 +01:00
parent 6dc6b5d8e9
commit d23bd71b7a
4 changed files with 39 additions and 15 deletions

View file

@ -83,6 +83,11 @@ describe('Anchor', function() {
parse({orient: -90, shift: [0, 1]}, 'name')(),
[1, 0, -90, {}]
)
// orient towards another point (and then move a diagonal to get to [1, 1])
check(
parse({orient: 'ten', shift: [0, Math.SQRT2]}, 'name', points)(),
[1, 1, -45, {}]
)
})
it('rotate', function() {
@ -97,6 +102,11 @@ describe('Anchor', function() {
parse({shift: [0, 1], rotate: -90}, 'name')(),
[0, 1, -90, {}]
)
// rotate towards another point
check(
parse({rotate: {shift: [-1, -1]}}, 'name')(),
[0, 0, 135, {}]
)
})
it('affect', function() {