geometry.resize returns obj for chaining. r=tschaub, (Closes #1931)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8840 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2009-02-05 22:28:22 +00:00
parent 3274491b95
commit 5cc2445a6a
5 changed files with 18 additions and 4 deletions

View File

@@ -272,11 +272,15 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, {
* will have four times the area).
* origin - {<OpenLayers.Geometry.Point>} Point of origin for resizing
* ratio - {Float} Optional x:y ratio for resizing. Default ratio is 1.
*
* Returns:
* {OpenLayers.Geometry} - The current geometry.
*/
resize: function(scale, origin, ratio) {
for(var i=0; i<this.components.length; ++i) {
this.components[i].resize(scale, origin, ratio);
}
return this;
},
/**

View File

@@ -148,11 +148,15 @@ OpenLayers.Geometry.LinearRing = OpenLayers.Class(
* will have four times the area).
* origin - {<OpenLayers.Geometry.Point>} Point of origin for resizing
* ratio - {Float} Optional x:y ratio for resizing. Default ratio is 1.
*
* Returns:
* {OpenLayers.Geometry} - The current geometry.
*/
resize: function(scale, origin, ratio) {
for(var i=0, len=this.components.length; i<len - 1; ++i) {
this.components[i].resize(scale, origin, ratio);
}
return this;
},
/**

View File

@@ -198,12 +198,16 @@ OpenLayers.Geometry.Point = OpenLayers.Class(OpenLayers.Geometry, {
* distance between the point and origin.
* origin - {<OpenLayers.Geometry.Point>} Point of origin for resizing
* ratio - {Float} Optional x:y ratio for resizing. Default ratio is 1.
*
* Returns:
* {OpenLayers.Geometry} - The current geometry.
*/
resize: function(scale, origin, ratio) {
ratio = (ratio == undefined) ? 1 : ratio;
this.x = origin.x + (scale * ratio * (this.x - origin.x));
this.y = origin.y + (scale * (this.y - origin.y));
this.clearBounds();
return this;
},
/**