Outlining improvements

This commit is contained in:
Bán Dénes 2022-05-29 20:25:52 +02:00
parent 5a25c1c423
commit 5e68bdb630
5 changed files with 92 additions and 80 deletions

View file

@ -25,6 +25,7 @@ module.exports = class Point {
}
shift(s, relative=true) {
s[0] *= this.meta.mirrored ? -1 : 1
if (relative) {
s = m.point.rotate(s, this.r)
}
@ -34,7 +35,10 @@ module.exports = class Point {
}
rotate(angle, origin=[0, 0]) {
this.p = m.point.rotate(this.p, angle, origin)
angle *= this.meta.mirrored ? -1 : 1
if (origin) {
this.p = m.point.rotate(this.p, angle, origin)
}
this.r += angle
return this
}