From 1b3fccc1632f518f2b1c6b29fc462fa6cd74d00a Mon Sep 17 00:00:00 2001 From: Lorenzo Stanco Date: Mon, 7 Jul 2014 11:08:39 +0200 Subject: [PATCH] Element.getSize() instead of Element.getComputedSize() in Mask.resize(), fixes #1273 --- Source/Interface/Mask.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Source/Interface/Mask.js b/Source/Interface/Mask.js index 39b21d03..de49414d 100644 --- a/Source/Interface/Mask.js +++ b/Source/Interface/Mask.js @@ -111,21 +111,23 @@ var Mask = new Class({ }, resize: function(x, y){ - var opt = { - styles: ['padding', 'border'] - }; - if (this.options.maskMargins) opt.styles.push('margin'); - var dim = this.target.getComputedSize(opt); + var dim = this.target.getSize(); + if (this.options.maskMargins) { + dim.x += this.target.getStyle('margin-left').toInt() + this.target.getStyle('margin-right').toInt(); + dim.y += this.target.getStyle('margin-top').toInt() + this.target.getStyle('margin-bottom').toInt(); + } + if (this.target == document.body){ this.element.setStyles({width: 0, height: 0}); var win = window.getScrollSize(); - if (dim.totalHeight < win.y) dim.totalHeight = win.y; - if (dim.totalWidth < win.x) dim.totalWidth = win.x; + if (dim.y < win.y) dim.y = win.y; + if (dim.x < win.x) dim.x = win.x; } + this.element.setStyles({ - width: Array.pick([x, dim.totalWidth, dim.x]), - height: Array.pick([y, dim.totalHeight, dim.y]) + width: Array.pick([x, dim.x]), + height: Array.pick([y, dim.y]) }); return this;