add offset() operation to OpenLayers.Pixel

git-svn-id: http://svn.openlayers.org/trunk/openlayers@444 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-29 11:48:42 +00:00
parent 0047f3e730
commit 0985ac299e
2 changed files with 26 additions and 0 deletions
+11
View File
@@ -66,6 +66,17 @@ OpenLayers.Pixel.prototype = {
return new OpenLayers.Pixel(this.x + x, this.y + y);
},
/**
* @param {OpenLayers.Pixel} px
*
* @return a new Pixel with this pixel's x&y augmented by the
* x&y values of the pixel passed in.
* @type OpenLayers.Pixel
*/
offset:function(px) {
return this.add(px.x, px.y);
},
/** @final @type str */
CLASS_NAME: "OpenLayers.Pixel"
};