geometry overlap

pull/3284/head
Lu[ke] Wilson 2024-03-28 11:59:13 +00:00
rodzic a85d3b605d
commit ff97a0c944
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -5040,8 +5040,15 @@ export class Editor extends EventEmitter<TLEventMap> {
// don't stick if your geometry doesn't intersect the other shape's geometry
// TODO: make this actually work!
const shapeGeometry = this.getShapeGeometry(shape)
const otherGeometry = this.getShapeGeometry(other)
if (!shapeGeometry.vertices.some((v) => otherGeometry.hitTestPoint(v, 0, true))) continue
const shapePageTransform = this.getShapePageTransform(shape)
if (
!shapeGeometry.vertices.some((v) => {
const point = shapePageTransform.applyToPoint(v)
return otherBounds.containsPoint(point)
})
) {
continue
}
return other
}