Fix outerWidth and outerHeight calculation in IE
This commit is contained in:
@@ -28,7 +28,7 @@ ol.dom.createCanvasContext2D = function(opt_width, opt_height) {
|
|||||||
*/
|
*/
|
||||||
ol.dom.outerWidth = function(element) {
|
ol.dom.outerWidth = function(element) {
|
||||||
var width = element.offsetWidth;
|
var width = element.offsetWidth;
|
||||||
var style = element.currentStyle || getComputedStyle(element);
|
var style = getComputedStyle(element);
|
||||||
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
|
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
|
||||||
|
|
||||||
return width;
|
return width;
|
||||||
@@ -44,7 +44,7 @@ ol.dom.outerWidth = function(element) {
|
|||||||
*/
|
*/
|
||||||
ol.dom.outerHeight = function(element) {
|
ol.dom.outerHeight = function(element) {
|
||||||
var height = element.offsetHeight;
|
var height = element.offsetHeight;
|
||||||
var style = element.currentStyle || getComputedStyle(element);
|
var style = getComputedStyle(element);
|
||||||
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
|
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
|
||||||
|
|
||||||
return height;
|
return height;
|
||||||
|
|||||||
Reference in New Issue
Block a user