MCPcopy
hub / github.com/fabricjs/fabric.js / intersectsWithObject

Method intersectsWithObject

src/shapes/Object/ObjectGeometry.ts:220–232  ·  view source on GitHub ↗

* Checks if object intersects with another object * @param {Object} other Object to test * @return {Boolean} true if object intersects with another object

(other: ObjectGeometry)

Source from the content-addressed store, hash-verified

218 * @return {Boolean} true if object intersects with another object
219 */
220 intersectsWithObject(other: ObjectGeometry): boolean {
221 const intersection = Intersection.intersectPolygonPolygon(
222 this.getCoords(),
223 other.getCoords()
224 );
225
226 return (
227 intersection.status === 'Intersection' ||
228 intersection.status === 'Coincident' ||
229 other.isContainedWithinObject(this) ||
230 this.isContainedWithinObject(other)
231 );
232 }
233
234 /**
235 * Checks if object is fully contained within area of another object

Callers 3

isOverlappingMethod · 0.95
object_geometry.jsFile · 0.80

Calls 3

getCoordsMethod · 0.95

Tested by

no test coverage detected