MCPcopy Index your code
hub / github.com/phaserjs/phaser / RectangleToRectangle

Function RectangleToRectangle

src/geom/intersects/RectangleToRectangle.js:22–30  ·  view source on GitHub ↗
(rectA, rectB)

Source from the content-addressed store, hash-verified

20 * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`.
21 */
22var RectangleToRectangle = function (rectA, rectB)
23{
24 if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0)
25 {
26 return false;
27 }
28
29 return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom);
30};
31
32module.exports = RectangleToRectangle;

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…