[OpenLayers-Commits] r11041 -
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Tue Jan 18 09:53:55 EST 2011
Author: erilem
Date: 2011-01-18 06:53:55 -0800 (Tue, 18 Jan 2011)
New Revision: 11041
Modified:
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
Log:
Handler.Path - stop events and disable "pan while drawing" when in freehand mode
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js 2011-01-18 14:53:46 UTC (rev 11040)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js 2011-01-18 14:53:55 UTC (rev 11041)
@@ -219,9 +219,14 @@
if (this.lastDown && this.lastDown.equals(evt.xy)) {
return false;
}
+ this.drawing = true;
this.mouseDown = true;
this.lastDown = evt.xy;
- return !this.stopDown;
+ if (this.freehandMode(evt)) {
+ return false;
+ } else {
+ return !this.stopDown;
+ }
},
/**
@@ -236,10 +241,9 @@
* {Boolean} Allow event propagation
*/
mousemove: function (evt) {
- if(this.drawing) {
- if(this.mouseDown && this.freehandMode(evt)) {
- this.addPoint(evt.xy);
- }
+ if(this.mouseDown && this.freehandMode(evt)) {
+ this.addPoint(evt.xy);
+ return false;
}
this.modifyFeature(evt.xy);
return true;
@@ -264,7 +268,6 @@
} else {
if(this.lastDown.equals(evt.xy)) {
this.addPoint(evt.xy);
- this.drawing = true;
this.lastUp = evt.xy;
}
}
More information about the Commits
mailing list