浏览代码

fix: regression on dragging a selected frame by its name (#8924)

fix hit element check for a selected frame's name
Ryan Di 7 月之前
父节点
当前提交
606ac6c743
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      packages/excalidraw/components/App.tsx

+ 5 - 1
packages/excalidraw/components/App.tsx

@@ -5085,7 +5085,11 @@ class App extends React.Component<AppProps, AppState> {
         isImageElement(element) ? 0 : this.getElementHitThreshold(),
       );
 
-      return isPointInShape(pointFrom(x, y), selectionShape);
+      // if hitting the bounding box, return early
+      // but if not, we should check for other cases as well (e.g. frame name)
+      if (isPointInShape(pointFrom(x, y), selectionShape)) {
+        return true;
+      }
     }
 
     // take bound text element into consideration for hit collision as well