diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index d7bb819d99..822026dd50 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -114,6 +114,18 @@ OpenLayers.Pixel.prototype = { return new OpenLayers.Pixel(this.x, this.y+h); }, + /** Return a new Pixel with this pixel's x&y augmented by + * the int values passed in. + * + * @param {int} x + * @param {int} x + * + * @return {OpenLayers.Pixel} + */ + add:function(x, y) { + return new OpenLayers.Pixel(this.x + x, this.y + y); + }, + //////////////////// who:function(){return "OpenLayers.Pixel";} };