Fix projection.clipExtent edge case.

A slight correction to clipLine fixed the problem with points lying
exactly on the clip edge, but in case clipLine(a, b) ever returns false
(no intersections) even though v_=0 and v=1, we treat this as the start
of a line anyway.
This commit is contained in:
Jason Davies 2013-03-16 15:49:48 +00:00
Родитель d8903ef00b
Коммит fa514dd08c
3 изменённых файлов: 8 добавлений и 5 удалений

2
d3.js поставляемый
Просмотреть файл

@ -2788,7 +2788,7 @@ d3 = function() {
}
}
function d3_geo_clipViewT(num, denominator, t) {
if (Math.abs(denominator) < ε) return num < 0;
if (Math.abs(denominator) < ε) return num <= 0;
var u = num / denominator;
if (denominator > 0) {
if (u > t[1]) return false;

6
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -134,6 +134,9 @@ function d3_geo_clipView(x0, y0, x1, y1) {
}
listener.point(b[0], b[1]);
if (!v) listener.lineEnd();
} else {
listener.lineStart();
listener.point(x, y);
}
}
}
@ -197,7 +200,7 @@ function d3_geo_clipView(x0, y0, x1, y1) {
}
function d3_geo_clipViewT(num, denominator, t) {
if (Math.abs(denominator) < ε) return num < 0;
if (Math.abs(denominator) < ε) return num <= 0;
var u = num / denominator;