@@ -2708,9 +2708,9 @@ d3 = function() {
27082708 a . next = b = array [ 0 ] ;
27092709 b . prev = a ;
27102710 }
2711- function d3_geo_clip ( pointVisible , clipLine , interpolate , polygonContains ) {
2711+ function d3_geo_clip ( pointVisible , clipLine , interpolate , clipPoint ) {
27122712 return function ( rotate , listener ) {
2713- var line = clipLine ( listener ) ;
2713+ var line = clipLine ( listener ) , rotatedClipPoint = rotate . invert ( clipPoint [ 0 ] , clipPoint [ 1 ] ) ;
27142714 var clip = {
27152715 point : point ,
27162716 lineStart : lineStart ,
@@ -2730,7 +2730,7 @@ d3 = function() {
27302730 segments = d3 . merge ( segments ) ;
27312731 if ( segments . length ) {
27322732 d3_geo_clipPolygon ( segments , d3_geo_clipSort , null , interpolate , listener ) ;
2733- } else if ( polygonContains ( rotate . invert , polygon ) ) {
2733+ } else if ( d3_geo_pointInPolygon ( rotatedClipPoint , polygon ) ) {
27342734 listener . lineStart ( ) ;
27352735 interpolate ( null , null , 1 , listener ) ;
27362736 listener . lineEnd ( ) ;
@@ -2851,7 +2851,7 @@ d3 = function() {
28512851 }
28522852 return ( polarAngle < - ε || polarAngle < ε && d3_geo_areaRingSum < 0 ) ^ winding & 1 ;
28532853 }
2854- var d3_geo_clipAntimeridian = d3_geo_clip ( d3_true , d3_geo_clipAntimeridianLine , d3_geo_clipAntimeridianInterpolate , d3_geo_clipAntimeridianPolygonContains ) ;
2854+ var d3_geo_clipAntimeridian = d3_geo_clip ( d3_true , d3_geo_clipAntimeridianLine , d3_geo_clipAntimeridianInterpolate , [ - π , 0 ] ) ;
28552855 function d3_geo_clipAntimeridianLine ( listener ) {
28562856 var λ0 = NaN , φ0 = NaN , sλ0 = NaN , clean ;
28572857 return {
@@ -2918,12 +2918,9 @@ d3 = function() {
29182918 listener . point ( to [ 0 ] , to [ 1 ] ) ;
29192919 }
29202920 }
2921- function d3_geo_clipAntimeridianPolygonContains ( rotate , polygon ) {
2922- return d3_geo_pointInPolygon ( rotate ( - π , 0 ) , polygon ) ;
2923- }
29242921 function d3_geo_clipCircle ( radius ) {
2925- var cr = Math . cos ( radius ) , smallRadius = cr > 0 , point = [ radius , 0 ] , notHemisphere = Math . abs ( cr ) > ε , interpolate = d3_geo_circleInterpolate ( radius , 6 * d3_radians ) ;
2926- return d3_geo_clip ( visible , clipLine , interpolate , polygonContains ) ;
2922+ var cr = Math . cos ( radius ) , smallRadius = cr > 0 , notHemisphere = Math . abs ( cr ) > ε , interpolate = d3_geo_circleInterpolate ( radius , 6 * d3_radians ) ;
2923+ return d3_geo_clip ( visible , clipLine , interpolate , [ radius , 0 ] ) ;
29272924 function visible ( λ , φ ) {
29282925 return Math . cos ( λ ) * Math . cos ( φ ) > cr ;
29292926 }
@@ -3016,9 +3013,6 @@ d3 = function() {
30163013 if ( φ < - r ) code |= 4 ; else if ( φ > r ) code |= 8 ;
30173014 return code ;
30183015 }
3019- function polygonContains ( rotate , polygon ) {
3020- return d3_geo_pointInPolygon ( rotate ( point [ 0 ] , point [ 1 ] ) , polygon ) ;
3021- }
30223016 }
30233017 var d3_geo_clipExtentMAX = 1e9 ;
30243018 d3 . geo . clipExtent = function ( ) {
0 commit comments