[OpenLayers-Commits] r12015 - sandbox/tschaub/editing/lib/OpenLayers/Handler

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed May 25 19:37:32 EDT 2011


Author: tschaub
Date: 2011-05-25 16:37:31 -0700 (Wed, 25 May 2011)
New Revision: 12015

Modified:
   sandbox/tschaub/editing/lib/OpenLayers/Handler/Path.js
Log:
Undoing until components can no longer be removed.

Modified: sandbox/tschaub/editing/lib/OpenLayers/Handler/Path.js
===================================================================
--- sandbox/tschaub/editing/lib/OpenLayers/Handler/Path.js	2011-05-25 23:36:24 UTC (rev 12014)
+++ sandbox/tschaub/editing/lib/OpenLayers/Handler/Path.js	2011-05-25 23:37:31 UTC (rev 12015)
@@ -266,15 +266,12 @@
      * {Boolean} A point was removed.
      */
     undo: function() {
-        var undone = false;
         var geometry = this.line.geometry;
+        var components = geometry.components;
         var index = this.getCurrentPointIndex() - 1;
-        var target = geometry.components[index];
-        var count = geometry.components.length;
-        if (count > 1) {
-            undone = true;
-            OpenLayers.Util.removeItem(geometry.components, target);
-            geometry.clearBounds();
+        var target = components[index];
+        var undone = geometry.removeComponent(target);
+        if (undone) {
             if (!this.redoStack) {
                 this.redoStack = [];
             }



More information about the Commits mailing list