Skip to content

Commit

Permalink
Merge pull request #784 from googlefonts/issue783
Browse files Browse the repository at this point in the history
Rect-select: handle empty component: its controlBounds will be null/undefined
  • Loading branch information
justvanrossum authored Sep 6, 2023
2 parents d246810 + 4f3ae61 commit b69ab8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fontra/client/core/glyph-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,10 @@ class ComponentController {
}

intersectsRect(rect) {
const controlBounds = this.controlBounds;
return (
sectRect(rect, this.controlBounds) &&
controlBounds &&
sectRect(rect, controlBounds) &&
(pointInConvexPolygon(rect.xMin, rect.yMin, this.convexHull) ||
rectIntersectsPolygon(rect, this.convexHull)) &&
this.unpackedContours.some(
Expand Down

0 comments on commit b69ab8d

Please sign in to comment.