More robust handling of polygons with empty ring(s).
This is a valid situation but won't usually happen at the moment since we don't return empty rings when clipping.
This commit is contained in:
Родитель
913173ea7f
Коммит
b1d078db1a
|
@ -6144,7 +6144,7 @@
|
||||||
var n = coordinates.length, i = -1, m, j, ring, point;
|
var n = coordinates.length, i = -1, m, j, ring, point;
|
||||||
while (++i < n) {
|
while (++i < n) {
|
||||||
ring = coordinates[i];
|
ring = coordinates[i];
|
||||||
if (!(m = ring.length - 1)) continue;
|
if ((m = ring.length - 1) < 1) continue;
|
||||||
point = ring[0];
|
point = ring[0];
|
||||||
context.moveTo(point[0], point[1]);
|
context.moveTo(point[0], point[1]);
|
||||||
for (j = 0; ++j < m; ) {
|
for (j = 0; ++j < m; ) {
|
||||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -40,7 +40,7 @@ d3.geo.path = function() {
|
||||||
point;
|
point;
|
||||||
while (++i < n) {
|
while (++i < n) {
|
||||||
ring = coordinates[i];
|
ring = coordinates[i];
|
||||||
if (!(m = ring.length - 1)) continue;
|
if ((m = ring.length - 1) < 1) continue;
|
||||||
point = ring[0];
|
point = ring[0];
|
||||||
context.moveTo(point[0], point[1]);
|
context.moveTo(point[0], point[1]);
|
||||||
for (j = 0; ++j < m;) {
|
for (j = 0; ++j < m;) {
|
||||||
|
|
|
@ -93,6 +93,7 @@ suite.addBatch({
|
||||||
assert.isNull(path(undefined));
|
assert.isNull(path(undefined));
|
||||||
assert.isNull(path());
|
assert.isNull(path());
|
||||||
},
|
},
|
||||||
|
|
||||||
"bogus type name": function(path) {
|
"bogus type name": function(path) {
|
||||||
assert.isNull(path({
|
assert.isNull(path({
|
||||||
type: "Feature",
|
type: "Feature",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче