Skip to content

Commit 8ad87e4

Browse files
committed
Fix clipping bug.
A point wasn't being inserted after the interpolated point when entering the clip region.
1 parent b5b187c commit 8ad87e4

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

d3.geo.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,9 @@ d3.geo.clip = function() {
751751
path = d3_geo_clipGreatCircle({source: q, target: o.target});
752752
j = d3_geo_clipClosest(path, o, r);
753753
if (path.length) clipped.push(path[j]);
754-
p = q = null;
755-
} else {
756-
clipped.push(o.target);
757754
}
755+
clipped.push(d[i]);
756+
p = q = null;
758757
} else {
759758
q = o.target;
760759
if (!p && clipped.length) {

d3.geo.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/geo/clip.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ d3.geo.clip = function() {
2222
path = d3_geo_clipGreatCircle({source: q, target: o.target});
2323
j = d3_geo_clipClosest(path, o, r);
2424
if (path.length) clipped.push(path[j]);
25-
p = q = null;
26-
} else {
27-
clipped.push(o.target);
2825
}
26+
clipped.push(d[i]);
27+
p = q = null;
2928
} else {
3029
q = o.target;
3130
if (!p && clipped.length) {

0 commit comments

Comments
 (0)