Add new test and fix code to make it work. Before, tests would sometimes
work in one direction, but not the other on interectsBounds. git-svn-id: http://svn.openlayers.org/trunk/openlayers@1533 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -491,17 +491,21 @@ OpenLayers.Bounds.prototype = {
|
||||
inclusive = true;
|
||||
}
|
||||
var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ?
|
||||
true : (bounds.bottom > this.bottom) && (bounds.bottom < this.top);
|
||||
true : (((bounds.bottom > this.bottom) && (bounds.bottom < this.top)) ||
|
||||
((this.bottom > bounds.bottom) && (this.bottom < bounds.top)));
|
||||
var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ?
|
||||
true : (bounds.top > this.bottom) && (bounds.top < this.top);
|
||||
true : (((bounds.top > this.bottom) && (bounds.top < this.top)) ||
|
||||
((this.top > bounds.bottom) && (this.top < bounds.top)));
|
||||
var inRight = (bounds.right == this.right && bounds.left == this.left) ?
|
||||
true : (bounds.right > this.left) && (bounds.right < this.right);
|
||||
true : (((bounds.right > this.left) && (bounds.right < this.right)) ||
|
||||
((this.right > bounds.left) && (this.right < bounds.right)));
|
||||
var inLeft = (bounds.right == this.right && bounds.left == this.left) ?
|
||||
true : (bounds.left > this.left) && (bounds.left < this.right);
|
||||
true : (((bounds.left > this.left) && (bounds.left < this.right)) ||
|
||||
((this.left > bounds.left) && (this.left < bounds.right)));
|
||||
|
||||
return (this.containsBounds(bounds, true, inclusive) ||
|
||||
bounds.containsBounds(this, true, inclusive) ||
|
||||
(inTop || inBottom ) && (inLeft || inRight ));
|
||||
((inTop || inBottom ) && (inLeft || inRight )));
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user