Commented out code to cancel zoom box if shift key is released before left mouse button. I find myself doing this consistently by accident, so we should probably find another way to cancel the zoom, like hittin ESC or something.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@245 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-05-22 03:47:19 +00:00
parent 7999253c74
commit af7dc7661a

View File

@@ -51,10 +51,15 @@ OpenLayers.Control.MouseDefaults.prototype =
defaultMouseMove: function (evt) {
if (this.mouseDragStart != null) {
if (this.zoomBox) {
/* after initially suggesting it, I'm not so sure
* this is a good idea ...
* I always let up off the shift key too early
* and cancel my zoombox by accident - SDE
if (!evt.shiftKey) {
this.defaultMouseUp(evt);
return;
}
*/
var deltaX = Math.abs(this.mouseDragStart.x - evt.xy.x);
var deltaY = Math.abs(this.mouseDragStart.y - evt.xy.y);
this.zoomBox.style.width = deltaX+"px";