@@ -242,7 +242,10 @@ function _clip(ctx, target, clipY) {
242242}
243243
244244const TAU = Math . PI * 2 ;
245- function getBounds ( axis , first , last ) {
245+ function getBounds ( axis , first , last , loop ) {
246+ if ( loop ) {
247+ return ;
248+ }
246249 let start = first [ axis ] ;
247250 let end = last [ axis ] ;
248251
@@ -259,21 +262,20 @@ function _segments(line, target, axis) {
259262 const parts = [ ] ;
260263
261264 for ( let segment of line . segments ) {
262- const bounds = getBounds ( axis , points [ segment . start ] . _view , points [ segment . end ] . _view ) ;
265+ const bounds = getBounds ( axis , points [ segment . start ] . _view , points [ segment . end ] . _view , segment . loop ) ;
263266
264267 if ( ! target . segments ) {
265268 // Special case for boundary not supporting `segments` (simpleArc)
266269 // Bounds are provided as `target` for partial circle, or undefined for full circle
267- parts . push ( { source : segment , target : ! segment . loop && bounds } ) ;
270+ parts . push ( { source : segment , target : bounds } ) ;
268271 continue ;
269272 }
270273
271274 // Get all segments from `target` that intersect the bounds of current segment of `line`
272- const subs = segment . loop ? target . segments : boundSegments ( target , bounds ) ;
275+ const subs = boundSegments ( target , bounds ) ;
273276
274277 for ( let sub of subs ) {
275- const fillSources = sub . loop ? [ segment ] :
276- boundSegment ( segment , points , getBounds ( axis , tpoints [ sub . start ] . _view , tpoints [ sub . end ] . _view ) ) ;
278+ const fillSources = boundSegment ( segment , points , getBounds ( axis , tpoints [ sub . start ] . _view , tpoints [ sub . end ] . _view , sub . loop ) ) ;
277279
278280 for ( let source of fillSources ) {
279281 parts . push ( { source, target : sub } ) ;
0 commit comments