"Draw bug in OpenLayers.Handler.Box with firefox". Now always set style.left and style.top, so lost events won't result in an incorrect box any more. r=me (closes #1579)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7375 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -84,16 +84,14 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, {
|
|||||||
* Method: moveBox
|
* Method: moveBox
|
||||||
*/
|
*/
|
||||||
moveBox: function (xy) {
|
moveBox: function (xy) {
|
||||||
var deltaX = Math.abs(this.dragHandler.start.x - xy.x);
|
var startX = this.dragHandler.start.x;
|
||||||
var deltaY = Math.abs(this.dragHandler.start.y - xy.y);
|
var startY = this.dragHandler.start.y;
|
||||||
|
var deltaX = Math.abs(startX - xy.x);
|
||||||
|
var deltaY = Math.abs(startY - xy.y);
|
||||||
this.zoomBox.style.width = Math.max(1, deltaX) + "px";
|
this.zoomBox.style.width = Math.max(1, deltaX) + "px";
|
||||||
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
|
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
|
||||||
if (xy.x < this.dragHandler.start.x) {
|
this.zoomBox.style.left = xy.x < startX ? xy.x+"px" : startX+"px";
|
||||||
this.zoomBox.style.left = xy.x+"px";
|
this.zoomBox.style.top = xy.y < startY ? xy.y+"px" : startY+"px";
|
||||||
}
|
|
||||||
if (xy.y < this.dragHandler.start.y) {
|
|
||||||
this.zoomBox.style.top = xy.y+"px";
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user