From 6605cd09846676c8769222d4d81cc1df18674669 Mon Sep 17 00:00:00 2001 From: euzuro Date: Tue, 16 May 2006 18:24:33 +0000 Subject: [PATCH] add new 'add' method to OpenLayers.Pixel -- eventually this will replace addX, addY, and addSize. git-svn-id: http://svn.openlayers.org/trunk/openlayers@48 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Util.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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";} };