2018-10-18 13:59:27 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2019-01-15 16:20:22 +00:00
|
|
|
* @copyright 2019 Photon Storm Ltd.
|
2018-10-18 13:59:27 +00:00
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
|
|
|
var GetBounds = require('./GetBounds');
|
|
|
|
var LayoutBounds = require('./LayoutBounds');
|
|
|
|
|
|
|
|
var InLayoutViewport = function (element, cushion)
|
|
|
|
{
|
|
|
|
var r = GetBounds(element, cushion);
|
|
|
|
|
|
|
|
return !!r && r.bottom >= 0 && r.right >= 0 && r.top <= LayoutBounds.width && r.left <= LayoutBounds.height;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = InLayoutViewport;
|