MCPcopy Create free account
hub / github.com/melonjs/melonJS / containsRectangle

Method containsRectangle

packages/melonjs/src/geometries/rectangle.ts:252–259  ·  view source on GitHub ↗

* Returns true if the rectangle contains the given rectangle * @param rectangle - rectangle to test * @returns True if the rectangle contain the given rectangle, otherwise false * @example * if (rect.containsRectangle(myRect)) { * // do something * }

(rectangle: Rect)

Source from the content-addressed store, hash-verified

250 * }
251 */
252 containsRectangle(rectangle: Rect) {
253 return (
254 rectangle.left >= this.left &&
255 rectangle.right <= this.right &&
256 rectangle.top >= this.top &&
257 rectangle.bottom <= this.bottom
258 );
259 }
260
261 /**
262 * Check if this rectangle is identical to the specified one.

Callers 2

rectangle.spec.tsFile · 0.45
roundrect.spec.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected