OpenLayers OpenLayers

Ticket #666: handler_bounds_polygon.patch

File handler_bounds_polygon.patch, 1.6 kB (added by pgiraud, 1 year ago)

added missing clearBounds() call in Handler.Polygon and modified test

  • /home/pierre/public_html/openlayers_666/lib/OpenLayers/Handler/Polygon.js

    old new  
    7878        var index = this.line.geometry.components.length - 2; 
    7979        this.line.geometry.components[index].x = this.point.geometry.x; 
    8080        this.line.geometry.components[index].y = this.point.geometry.y; 
     81        this.line.geometry.components[index].clearBounds(); 
    8182    }, 
    8283 
    8384    /** 
  • /home/pierre/public_html/openlayers_666/tests/Handler/test_Polygon.html

    old new  
    6464        handler.mousedown(evt); 
    6565        var evt = {xy: new OpenLayers.Pixel(125, 100), which: 1}; 
    6666        handler.mousemove(evt); 
    67         t.ok(handler.polygon.geometry.getBounds().equals(new OpenLayers.Bounds(0,-35.15625,35.15625,0)), 
     67        t.ok(!handler.polygon.geometry.getBounds().equals(new OpenLayers.Bounds(0,-35.15625,35.15625,0)), 
    6868             "Correct bounds after dragging without letting go. (Came out as "+handler.line.geometry.getBounds().toBBOX() + ".)"); 
    6969    } 
    7070