Finishing Schuyler's commit the other day, which was designed to change behavior on release of shift key, but failed to actually do so...

git-svn-id: http://svn.openlayers.org/trunk/openlayers@276 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-23 14:45:51 +00:00
parent 1041515bfd
commit 81c9315c17
-11
View File
@@ -51,15 +51,6 @@ OpenLayers.Control.MouseDefaults.prototype =
defaultMouseMove: function (evt) { defaultMouseMove: function (evt) {
if (this.mouseDragStart != null) { if (this.mouseDragStart != null) {
if (this.zoomBox) { 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 deltaX = Math.abs(this.mouseDragStart.x - evt.xy.x);
var deltaY = Math.abs(this.mouseDragStart.y - evt.xy.y); var deltaY = Math.abs(this.mouseDragStart.y - evt.xy.y);
this.zoomBox.style.width = deltaX+"px"; this.zoomBox.style.width = deltaX+"px";
@@ -88,7 +79,6 @@ OpenLayers.Control.MouseDefaults.prototype =
*/ */
defaultMouseUp: function (evt) { defaultMouseUp: function (evt) {
if (this.zoomBox) { if (this.zoomBox) {
if (evt.shiftKey) {
var start = this.map.getLonLatFromPixel( this.mouseDragStart ); var start = this.map.getLonLatFromPixel( this.mouseDragStart );
var end = this.map.getLonLatFromPixel( evt.xy ); var end = this.map.getLonLatFromPixel( evt.xy );
var top = Math.max(start.lat, end.lat); var top = Math.max(start.lat, end.lat);
@@ -101,7 +91,6 @@ OpenLayers.Control.MouseDefaults.prototype =
(start.lon + end.lon) / 2, (start.lon + end.lon) / 2,
(start.lat + end.lat) / 2 (start.lat + end.lat) / 2
), zoom); ), zoom);
}
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox")); this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
this.zoomBox = null; this.zoomBox = null;
} }