mirror of
https://github.com/photonstorm/phaser
synced 2025-01-05 17:58:48 +00:00
17 lines
536 B
JavaScript
17 lines
536 B
JavaScript
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2019 Photon Storm Ltd.
|
|
* @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;
|