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:
Michael Yoshitaka Erlewine 2010-09-03 14:43:24 -04:00
Родитель 975ce1e1b2
Коммит ae76fadf25
2 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -322,6 +322,20 @@ Range.prototype = {
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
// 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) {
return (this.position - this.radius < position &&
position < this.position + this.radius &&
this.activeRange.contains(range));
this.activeRange.overlaps(range));
},
//----------