adding irregular option to regular polygon control - now, go draw rectangles, and more - thanks for the review elem (closes #1098).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5200 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -269,10 +269,11 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, {
|
||||
* (lines, for example, will be twice as long, and polygons
|
||||
* 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.
|
||||
*/
|
||||
resize: function(scale, origin) {
|
||||
resize: function(scale, origin, ratio) {
|
||||
for(var i=0; i<this.components.length; ++i) {
|
||||
this.components[i].resize(scale, origin);
|
||||
this.components[i].resize(scale, origin, ratio);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -145,10 +145,11 @@ OpenLayers.Geometry.LinearRing = OpenLayers.Class(
|
||||
* (lines, for example, will be twice as long, and polygons
|
||||
* 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.
|
||||
*/
|
||||
resize: function(scale, origin) {
|
||||
resize: function(scale, origin, ratio) {
|
||||
for(var i=0; i<this.components.length - 1; ++i) {
|
||||
this.components[i].resize(scale, origin);
|
||||
this.components[i].resize(scale, origin, ratio);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -160,10 +160,11 @@ OpenLayers.Geometry.Point = OpenLayers.Class(OpenLayers.Geometry, {
|
||||
* distance from the origin. A scale of 2 doubles the
|
||||
* 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.
|
||||
*/
|
||||
resize: function(scale, origin) {
|
||||
this.x = origin.x + (scale * (this.x - origin.x));
|
||||
|
||||
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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user