Merge pull request #6623 from ahocevar/outerwidth-outerheight

Fix outerWidth and outerHeight calculation in IE
This commit is contained in:
Andreas Hocevar
2017-03-22 15:52:52 +01:00
committed by GitHub

View File

@@ -28,7 +28,7 @@ ol.dom.createCanvasContext2D = function(opt_width, opt_height) {
*/
ol.dom.outerWidth = function(element) {
var width = element.offsetWidth;
var style = element.currentStyle || getComputedStyle(element);
var style = getComputedStyle(element);
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
return width;
@@ -44,7 +44,7 @@ ol.dom.outerWidth = function(element) {
*/
ol.dom.outerHeight = function(element) {
var height = element.offsetHeight;
var style = element.currentStyle || getComputedStyle(element);
var style = getComputedStyle(element);
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
return height;