Applied patch for #514 to fix map.getCurrentSize() in Safari.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2306 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-03-05 12:39:18 +00:00
parent d36553f135
commit baa78896e8

View File

@@ -628,12 +628,12 @@ OpenLayers.Map.prototype = {
this.div.clientHeight);
// Workaround for the fact that hidden elements return 0 for size.
if (size.w == 0 && size.h == 0) {
if (size.w == 0 && size.h == 0 || isNaN(size.w) && isNaN(size.h)) {
var dim = OpenLayers.Element.getDimensions(this.div);
size.w = dim.width;
size.h = dim.height;
}
if (size.w == 0 && size.h == 0) {
if (size.w == 0 && size.h == 0 || isNaN(size.w) && isNaN(size.h)) {
size.w = parseInt(this.div.style.width);
size.h = parseInt(this.div.style.height);
}