Fix bug in ellipse (#292)

This commit is contained in:
Steve Ruiz 2021-11-18 16:33:12 +00:00 committed by GitHub
parent e542f1fde5
commit 2f1816404b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -262,6 +262,10 @@ export class EllipseUtil extends TDShapeUtil<T, E> {
).points.sort((a, b) => Vec.dist(a, point) - Vec.dist(b, point))[0] ).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 // The anchor is a point between the handle and the intersection
const anchor = Vec.med(point, intersection) const anchor = Vec.med(point, intersection)