(rectA, rectB)
| 20 | * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`. |
| 21 | */ |
| 22 | var 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 | |
| 32 | module.exports = RectangleToRectangle; |
no outgoing calls
no test coverage detected
searching dependent graphs…