[OpenLayers-Commits] r4217 - in trunk/openlayers: lib/OpenLayers/Handler tests/Handler

commits at openlayers.org commits at openlayers.org
Tue Sep 11 10:26:09 EDT 2007


Author: crschmidt
Date: 2007-09-11 10:26:08 -0400 (Tue, 11 Sep 2007)
New Revision: 4217

Modified:
   trunk/openlayers/lib/OpenLayers/Handler/Polygon.js
   trunk/openlayers/tests/Handler/test_Polygon.html
Log:
Fix lacking code from #666-- I had originally wanted to add this, but couldn't
craft a test which exposed the lack ... until i realized with pgiraud's help
that my test was backwards to begin with. (Closes #666)


Modified: trunk/openlayers/lib/OpenLayers/Handler/Polygon.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Polygon.js	2007-09-11 14:23:37 UTC (rev 4216)
+++ trunk/openlayers/lib/OpenLayers/Handler/Polygon.js	2007-09-11 14:26:08 UTC (rev 4217)
@@ -78,6 +78,7 @@
         var index = this.line.geometry.components.length - 2;
         this.line.geometry.components[index].x = this.point.geometry.x;
         this.line.geometry.components[index].y = this.point.geometry.y;
+        this.line.geometry.components[index].clearBounds();
     },
 
     /**

Modified: trunk/openlayers/tests/Handler/test_Polygon.html
===================================================================
--- trunk/openlayers/tests/Handler/test_Polygon.html	2007-09-11 14:23:37 UTC (rev 4216)
+++ trunk/openlayers/tests/Handler/test_Polygon.html	2007-09-11 14:26:08 UTC (rev 4217)
@@ -64,7 +64,7 @@
         handler.mousedown(evt);
         var evt = {xy: new OpenLayers.Pixel(125, 100), which: 1};
         handler.mousemove(evt);
-        t.ok(handler.polygon.geometry.getBounds().equals(new OpenLayers.Bounds(0,-35.15625,35.15625,0)),
+        t.ok(!handler.polygon.geometry.getBounds().equals(new OpenLayers.Bounds(0,-35.15625,35.15625,0)),
              "Correct bounds after dragging without letting go. (Came out as "+handler.line.geometry.getBounds().toBBOX() + ".)");
     }
 



More information about the Commits mailing list