diff options
Diffstat (limited to 'src/pen-gestures/ndollar.ts')
| -rw-r--r-- | src/pen-gestures/ndollar.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pen-gestures/ndollar.ts b/src/pen-gestures/ndollar.ts index bdb79b446..ff7f7310b 100644 --- a/src/pen-gestures/ndollar.ts +++ b/src/pen-gestures/ndollar.ts @@ -463,7 +463,7 @@ function ScaleDimTo(points: any, size: any, ratio1D: any) { const B = BoundingBox(points); const uniformly = Math.min(B.Width / B.Height, B.Height / B.Width) <= ratio1D; // 1D or 2D gesture test const newpoints: Point[] = []; - points.forEach((X: any, Y: any) => { + points.forEach(({ X, Y }) => { const qx = uniformly ? X * (size / Math.max(B.Width, B.Height)) : X * (size / B.Width); const qy = uniformly ? Y * (size / Math.max(B.Width, B.Height)) : Y * (size / B.Height); newpoints[newpoints.length] = new Point(qx, qy); @@ -474,7 +474,7 @@ function TranslateTo(points: any, pt: any) { // translates points' centroid const c = Centroid(points); const newpoints: Point[] = []; - points.forEach((X: any, Y: any) => { + points.forEach(({ X, Y }) => { const qx = X + pt.X - c.X; const qy = Y + pt.Y - c.Y; newpoints[newpoints.length] = new Point(qx, qy); @@ -548,9 +548,9 @@ function DistanceAtAngle(points: any, T: any, radians: any) { function Centroid(points: Point[]) { let x = 0.0; let y = 0.0; - points.forEach(point => { - x += point.X; - y += point.Y; + points.forEach(({ X, Y }) => { + x += X; + y += Y; }); x /= points.length; y /= points.length; @@ -561,7 +561,7 @@ function BoundingBox(points: Point[]) { let maxX = -Infinity; let minY = +Infinity; let maxY = -Infinity; - points.forEach((X: any, Y: any) => { + points.forEach(({ X, Y }) => { minX = Math.min(minX, X); minY = Math.min(minY, Y); maxX = Math.max(maxX, X); |
