diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index d156d61a1b..3fdd2aa2b0 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -115,7 +115,11 @@ OpenLayers.Pixel.prototype = { * @type OpenLayers.Pixel */ offset:function(px) { - return this.add(px.x, px.y); + var newPx = this.clone(); + if (px) { + newPx = this.add(px.x, px.y); + } + return newPx; }, /** @final @type str */