diff options
author | bobzel <zzzman@gmail.com> | 2021-09-30 16:06:27 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-30 16:06:27 -0400 |
commit | c457efd3d57359c285bd00a65c9fdce7a27e27f6 (patch) | |
tree | 451435e789d17cd1ef71976cc71abd877a47c2fd | |
parent | c0423cc9c04e87bb4bff79d2d1bcdd0612efb1a2 (diff) |
fixed ink rotation
-rw-r--r-- | src/client/views/InkStrokeProperties.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts index 68169f246..ef4976b77 100644 --- a/src/client/views/InkStrokeProperties.ts +++ b/src/client/views/InkStrokeProperties.ts @@ -171,8 +171,8 @@ export class InkStrokeProperties { const centerPoint = { X: (oldXrange.min + oldXrange.max) / 2, Y: (oldYrange.min + oldYrange.max) / 2 }; const newPoints = ink.map(i => { const pt = { X: i.X - centerPoint.X, Y: i.Y - centerPoint.Y }; - const newX = Math.cos(angle) * pt.X - Math.sin(angle) * pt.Y; - const newY = Math.sin(angle) * pt.X + Math.cos(angle) * pt.Y; + const newX = Math.cos(angle) * pt.X - Math.sin(angle) * pt.Y * yScale / xScale; + const newY = Math.sin(angle) * pt.X * xScale / yScale + Math.cos(angle) * pt.Y; return { X: newX + centerPoint.X, Y: newY + centerPoint.Y }; }); doc.rotation = NumCast(doc.rotation) + angle; |