Selaa lähdekoodia

fix: try using inViewPort optimization again

Peng Xiao 3 vuotta sitten
vanhempi
sitoutus
3235d2d2ac

+ 4 - 5
tldraw/packages/core/src/lib/TLApp/TLApp.ts

@@ -640,11 +640,10 @@ export class TLApp<
     } = this
     return currentPage.shapes.filter(shape => {
       return (
-        shape.props.parentId === currentPage.id &&
-        (!shape.canUnmount ||
-          selectedShapes.has(shape) ||
-          BoundsUtils.boundsContain(currentView, shape.rotatedBounds) ||
-          BoundsUtils.boundsCollide(currentView, shape.rotatedBounds))
+        !shape.canUnmount ||
+        selectedShapes.has(shape) ||
+        BoundsUtils.boundsContain(currentView, shape.rotatedBounds) ||
+        BoundsUtils.boundsCollide(currentView, shape.rotatedBounds)
       )
     })
   }

+ 4 - 0
tldraw/packages/core/src/lib/tools/TLSelectTool/states/PinchingState.ts

@@ -34,4 +34,8 @@ export class PinchingState<
   onPinchEnd: TLEvents<S>['pinch'] = () => {
     this.tool.transition('idle')
   }
+
+  onPointerDown: TLEvents<S>['pointer'] = () => {
+    this.tool.transition('idle')
+  }
 }

+ 1 - 1
tldraw/packages/react/src/components/AppCanvas.tsx

@@ -24,7 +24,7 @@ export const AppCanvas = observer(function InnerApp<S extends TLReactShape>(
       selectionBounds={app.selectionBounds}
       selectedShapes={app.selectedShapesArray}
       erasingShapes={app.erasingShapesArray}
-      shapes={app.shapes}
+      shapes={app.shapesInViewport}
       assets={app.assets}
       showGrid={app.settings.showGrid}
       showSelection={app.showSelection}