[OpenLayers-Commits] r11115 -
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Sun Feb 13 17:09:08 EST 2011
Author: erilem
Date: 2011-02-13 14:09:08 -0800 (Sun, 13 Feb 2011)
New Revision: 11115
Modified:
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
Log:
smoother transitions from freehand to non-freehand
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js 2011-02-13 22:08:57 UTC (rev 11114)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js 2011-02-13 22:09:08 UTC (rev 11115)
@@ -266,7 +266,9 @@
this.addPoint(evt.xy);
return false;
}
- if(!this.mouseDown) {
+ // if the mouse is down and if freehand was active when
+ // the mousedown occurred we move the feature here
+ if(!this.mouseDown || this.freehandMouseDown) {
this.modifyFeature(evt.xy, !!this.lastUp);
}
return true;
@@ -294,7 +296,9 @@
this.removePoint();
this.finalize();
} else {
- if(this.lastDown.equals(evt.xy)) {
+ // we add a point if freehand was active when the mousedown
+ // occurred
+ if(this.lastDown.equals(evt.xy) || this.freehandMouseDown) {
var first = this.lastUp == null;
if(first && this.persist) {
this.destroyPersistedFeature();
More information about the Commits
mailing list