[OpenLayers-Commits] r11138 - sandbox/elemoine/draw-feature/lib/OpenLayers/Handler

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Feb 17 16:13:11 EST 2011


Author: erilem
Date: 2011-02-17 13:13:11 -0800 (Thu, 17 Feb 2011)
New Revision: 11138

Modified:
   sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
   sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js
Log:
need stoppedDown for the point handler as well

Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js	2011-02-17 21:13:02 UTC (rev 11137)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Path.js	2011-02-17 21:13:11 UTC (rev 11138)
@@ -45,13 +45,6 @@
     freehandToggle: 'shiftKey',
 
     /**
-     * Property: stoppedDown
-     * {Boolean} Indicate whether the last mousedown stopped the event
-     * propagation.
-     */
-    stoppedDown: null,
-
-    /**
      * Constructor: OpenLayers.Handler.Path
      * Create a new path hander
      *

Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js	2011-02-17 21:13:02 UTC (rev 11137)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js	2011-02-17 21:13:11 UTC (rev 11138)
@@ -49,6 +49,13 @@
     mouseDown: false,
 
     /**
+     * Property: stoppedDown
+     * {Boolean} Indicate whether the last mousedown stopped the event
+     * propagation.
+     */
+    stoppedDown: null,
+
+    /**
      * Property: lastDown
      * {<OpenLayers.Pixel>} Location of the last mouse down
      */
@@ -342,6 +349,7 @@
         this.mouseDown = true;
         this.lastDown = evt.xy;
         this.modifyFeature(evt.xy);
+        this.stoppedDown = this.stopDown;
         return !this.stopDown;
     },
 
@@ -357,7 +365,7 @@
      * {Boolean} Allow event propagation
      */
     mousemove: function (evt) {
-        if(!this.mouseDown) {
+        if(!this.mouseDown || this.stoppedDown) {
             this.modifyFeature(evt.xy);
         }
         return true;
@@ -375,7 +383,8 @@
      * {Boolean} Allow event propagation
      */
     mouseup: function (evt) {
-         this.mouseDown = false;
+        this.mouseDown = false;
+        this.stoppedDown = this.stopDown;
         // check keyboard modifiers
         if(!this.checkModifiers(evt)) {
             return true;



More information about the Commits mailing list