зеркало из https://github.com/mozilla/pjs.git
Bug 591167: border trenches should be triggered even if the edge only overlaps, but is not contained by the active range of the trench [r+a=dietrich]
This commit is contained in:
Родитель
975ce1e1b2
Коммит
ae76fadf25
|
@ -322,6 +322,20 @@ Range.prototype = {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
// Function: overlaps
|
||||||
|
// Whether the <Range> overlaps with the given <Range> or value or not.
|
||||||
|
//
|
||||||
|
// Paramaters
|
||||||
|
// - a number or <Range>
|
||||||
|
overlaps: function Rect_overlaps(value) {
|
||||||
|
if (Utils.isNumber(value))
|
||||||
|
return this.contains(value);
|
||||||
|
if (Utils.isRange(value))
|
||||||
|
return !(value.max < this.min || this.max < value.min);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
// Function: proportion
|
// Function: proportion
|
||||||
// Maps the given value to the range [0,1], so that it returns 0 if the value is <= the min,
|
// Maps the given value to the range [0,1], so that it returns 0 if the value is <= the min,
|
||||||
|
|
|
@ -382,7 +382,7 @@ Trench.prototype = {
|
||||||
ruleOverlaps: function Trench_ruleOverlaps(position, range) {
|
ruleOverlaps: function Trench_ruleOverlaps(position, range) {
|
||||||
return (this.position - this.radius < position &&
|
return (this.position - this.radius < position &&
|
||||||
position < this.position + this.radius &&
|
position < this.position + this.radius &&
|
||||||
this.activeRange.contains(range));
|
this.activeRange.overlaps(range));
|
||||||
},
|
},
|
||||||
|
|
||||||
//----------
|
//----------
|
||||||
|
|
Загрузка…
Ссылка в новой задаче