aboutsummaryrefslogtreecommitdiff
path: root/src/pen-gestures/ndollar.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/pen-gestures/ndollar.ts')
-rw-r--r--src/pen-gestures/ndollar.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pen-gestures/ndollar.ts b/src/pen-gestures/ndollar.ts
index 9d42035d1..ecd8df3e7 100644
--- a/src/pen-gestures/ndollar.ts
+++ b/src/pen-gestures/ndollar.ts
@@ -552,7 +552,7 @@ function Distance(p1: any, p2: any) // distance between two points
}
function CalcStartUnitVector(points: any, index: any) // start angle from points[0] to points[index] normalized as a unit vector
{
- const v = new Point(points[index].X - points[0].X, points[index].Y - points[0].Y);
+ const v = new Point(points[index]?.X - points[0]?.X, points[index]?.Y - points[0]?.Y);
const len = Math.sqrt(v.X * v.X + v.Y * v.Y);
return new Point(v.X / len, v.Y / len);
}