2017-01-02 00:47:16 +00:00
|
|
|
var Contains = require('./Contains');
|
|
|
|
|
2017-10-13 13:11:54 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @function Phaser.Geom.Ellipse.ContainsRect
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Geom.Ellipse} ellipse - [description]
|
|
|
|
* @param {Phaser.Geom.Rectangle|object} rect - [description]
|
|
|
|
*
|
|
|
|
* @return {boolean} [description]
|
|
|
|
*/
|
2017-01-02 00:47:16 +00:00
|
|
|
var ContainsRect = function (ellipse, rect)
|
|
|
|
{
|
|
|
|
return (
|
|
|
|
Contains(ellipse, rect.x, rect.y) &&
|
|
|
|
Contains(ellipse, rect.right, rect.y) &&
|
|
|
|
Contains(ellipse, rect.x, rect.bottom) &&
|
|
|
|
Contains(ellipse, rect.right, rect.bottom)
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = ContainsRect;
|