diff --git a/lib/OpenLayers/Handler/Box.js b/lib/OpenLayers/Handler/Box.js index 9f5cd97f6d..caa07dfb05 100644 --- a/lib/OpenLayers/Handler/Box.js +++ b/lib/OpenLayers/Handler/Box.js @@ -99,11 +99,6 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, { this.map.eventsDiv.appendChild(this.zoomBox); - var offset = this.getBoxOffsets(); - var pos = this.dragHandler.start; - this.zoomBox.style.left = (pos.x - offset.left) + "px"; - this.zoomBox.style.top = (pos.y - offset.top) + "px"; - OpenLayers.Element.addClass( this.map.eventsDiv, "olDrawBox" ); diff --git a/tests/Handler/Box.html b/tests/Handler/Box.html index 85bb52f626..950ea7021a 100644 --- a/tests/Handler/Box.html +++ b/tests/Handler/Box.html @@ -39,7 +39,7 @@ map.div.removeChild(testdiv); var testAll = !isNaN(left); - t.plan(testAll ? 12 : 2); + t.plan(testAll ? 10 : 2); // we change NaN values to 0 values in the handler's // boxOffsets object, this is to prevent "invalid @@ -58,14 +58,10 @@ handler.dragHandler.start = {x: 5, y: 5}; handler.startBox(); offset = handler.getBoxOffsets(); + handler.moveBox({x: 10, y: 10}); if (testAll) { t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box correct"); t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box correct"); - } - handler.moveBox({x: 10, y: 10}); - if (testAll) { - t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box still correct"); - t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box still correct"); t.eq(parseInt(handler.zoomBox.style.width), 5 + offset.width + 1, "x dimension of box correct"); t.eq(parseInt(handler.zoomBox.style.height), 5 + offset.height + 1, "y dimension of box correct"); }