[OpenLayers-Commits] r11130 -
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Feb 16 16:19:08 EST 2011
Author: erilem
Date: 2011-02-16 13:19:08 -0800 (Wed, 16 Feb 2011)
New Revision: 11130
Modified:
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Polygon.js
Log:
make it possible to draw holes in freehand mode
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js 2011-02-16 20:43:26 UTC (rev 11129)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js 2011-02-16 21:19:08 UTC (rev 11130)
@@ -286,11 +286,10 @@
this.finalize();
} else {
if(this.lastDown.equals(evt.xy)) {
- var first = this.lastUp == null;
- if(first && this.persist) {
+ if(this.lastUp == null && this.persist) {
this.destroyPersistedFeature();
}
- this.addPoint(evt.xy, first);
+ this.addPoint(evt.xy);
this.lastUp = evt.xy;
}
}
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Polygon.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Polygon.js 2011-02-16 20:43:26 UTC (rev 11129)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Polygon.js 2011-02-16 21:19:08 UTC (rev 11130)
@@ -99,11 +99,9 @@
*
* Parameters:
* pixel - {<OpenLayers.Pixel>} The pixel location for the new point.
- * first - {Boolean} Indicate whether this is the first point we're
- * adding.
*/
- addPoint: function(pixel, first) {
- if(first && this.holeModifier &&
+ addPoint: function(pixel) {
+ if(!this.drawingHole && this.holeModifier &&
this.evt && this.evt[this.holeModifier]) {
var geometry = this.point.geometry;
var features = this.control.layer.features;
More information about the Commits
mailing list