aboutsummaryrefslogtreecommitdiff
path: root/src/pen-gestures/ndollar.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-01 09:47:11 -0400
committerbobzel <zzzman@gmail.com>2024-05-01 09:47:11 -0400
commit76838b7b3842c9b184e6459e29796dd14de37e8d (patch)
treef96cc6db69e72e90179e8b1c3003401146ee3522 /src/pen-gestures/ndollar.ts
parent098deaa68c8b9bb781748fbe0c1bd0104bab3596 (diff)
more cycle import removal. fixed ndollar bugs introduced during lint changes.
Diffstat (limited to 'src/pen-gestures/ndollar.ts')
-rw-r--r--src/pen-gestures/ndollar.ts12
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);