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 Class = require('../utils/Class');
|
|
|
|
var Rectangle = require('../geom/rectangle/Rectangle');
|
|
|
|
|
|
|
|
var DocumentBounds = new Class({
|
|
|
|
|
|
|
|
Extends: Rectangle,
|
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
|
|
|
function DocumentBounds ()
|
|
|
|
{
|
|
|
|
Rectangle.call(this);
|
|
|
|
},
|
|
|
|
|
|
|
|
width: {
|
|
|
|
get: function ()
|
|
|
|
{
|
|
|
|
var d = document.documentElement;
|
|
|
|
|
|
|
|
return Math.max(d.clientWidth, d.offsetWidth, d.scrollWidth);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
height: {
|
|
|
|
get: function ()
|
|
|
|
{
|
|
|
|
var d = document.documentElement;
|
|
|
|
|
|
|
|
return Math.max(d.clientHeight, d.offsetHeight, d.scrollHeight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = new DocumentBounds();
|