phaser/src/geom/circle/ContainsRect.js

25 lines
576 B
JavaScript
Raw Normal View History

2016-12-29 00:17:20 +00:00
var Contains = require('./Contains');
/**
* [description]
*
* @function Phaser.Geom.Circle.ContainsRect
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circle - [description]
* @param {Phaser.Geom.Rectangle|object} rect - [description]
2017-10-13 13:11:54 +00:00
*
* @return {boolean} [description]
*/
2016-12-29 00:17:20 +00:00
var ContainsRect = function (circle, rect)
{
return (
Contains(circle, rect.x, rect.y) &&
Contains(circle, rect.right, rect.y) &&
Contains(circle, rect.x, rect.bottom) &&
Contains(circle, rect.right, rect.bottom)
);
};
module.exports = ContainsRect;