@tldraw/editor 4.5.0-canary.7c0edb24b982 → 4.5.0-canary.7c873e27b89b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4268,6 +4268,11 @@ export declare abstract class Geometry2d {
4268
4268
  private _length?;
4269
4269
  get length(): number;
4270
4270
  getLength(_filters?: Geometry2dFilters): number;
4271
+ /**
4272
+ * Called after a hit test succeeds. Return `true` to reject the hit and allow
4273
+ * shapes behind this one to be selected instead (e.g. transparent image pixels).
4274
+ */
4275
+ ignoreHit(_point: VecLike): boolean;
4271
4276
  abstract getSvgPathData(first: boolean): string;
4272
4277
  }
4273
4278
 
@@ -8426,6 +8431,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
8426
8431
  intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): Vec[];
8427
8432
  intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
8428
8433
  intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
8434
+ ignoreHit(point: VecLike): boolean;
8429
8435
  transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
8430
8436
  getSvgPathData(): string;
8431
8437
  }
package/dist-cjs/index.js CHANGED
@@ -369,7 +369,7 @@ var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
369
369
  var import_uniq = require("./lib/utils/uniq");
370
370
  (0, import_utils.registerTldrawLibraryVersion)(
371
371
  "@tldraw/editor",
372
- "4.5.0-canary.7c0edb24b982",
372
+ "4.5.0-canary.7c873e27b89b",
373
373
  "cjs"
374
374
  );
375
375
  //# sourceMappingURL=index.js.map
@@ -3990,6 +3990,9 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
3990
3990
  if (geometry.isClosed) {
3991
3991
  if (distance <= outerMargin || hitInside && distance <= 0 && distance > -innerMargin) {
3992
3992
  if (geometry.isFilled || isGroup && geometry.children[0].isFilled) {
3993
+ if (geometry.ignoreHit(pointInShapeSpace)) {
3994
+ continue;
3995
+ }
3993
3996
  return inMarginClosestToEdgeHit || shape;
3994
3997
  } else {
3995
3998
  if (this.getShapePageBounds(shape).contains(viewportPageBounds)) continue;