From 8b909e9e5366afffd52c644ecdd2f472be9499c6 Mon Sep 17 00:00:00 2001 From: euzuro Date: Fri, 6 Oct 2006 18:23:51 +0000 Subject: [PATCH] bringing down r1660 from sandbox/euzuro/layerclone git-svn-id: http://svn.openlayers.org/trunk/openlayers@1661 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/BaseTypes.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */