From 2f1816404b7c4668b4ff98edb82e6885291e4312 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Thu, 18 Nov 2021 16:33:12 +0000 Subject: [PATCH] Fix bug in ellipse (#292) --- packages/tldraw/src/state/shapes/EllipseUtil/EllipseUtil.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/tldraw/src/state/shapes/EllipseUtil/EllipseUtil.tsx b/packages/tldraw/src/state/shapes/EllipseUtil/EllipseUtil.tsx index 99a64c63c..bafc695b8 100644 --- a/packages/tldraw/src/state/shapes/EllipseUtil/EllipseUtil.tsx +++ b/packages/tldraw/src/state/shapes/EllipseUtil/EllipseUtil.tsx @@ -262,6 +262,10 @@ export class EllipseUtil extends TDShapeUtil { ).points.sort((a, b) => Vec.dist(a, point) - Vec.dist(b, point))[0] } + if (!intersection) { + return undefined + } + // The anchor is a point between the handle and the intersection const anchor = Vec.med(point, intersection)