(line, segmentOptions)
| 236 | * @private |
| 237 | */ |
| 238 | export function _computeSegments(line, segmentOptions) { |
| 239 | const points = line.points; |
| 240 | const spanGaps = line.options.spanGaps; |
| 241 | const count = points.length; |
| 242 | |
| 243 | if (!count) { |
| 244 | return []; |
| 245 | } |
| 246 | |
| 247 | const loop = !!line._loop; |
| 248 | const {start, end} = findStartAndEnd(points, count, loop, spanGaps); |
| 249 | |
| 250 | if (spanGaps === true) { |
| 251 | return splitByStyles(line, [{start, end, loop}], points, segmentOptions); |
| 252 | } |
| 253 | |
| 254 | const max = end < start ? end + count : end; |
| 255 | const completeLoop = !!line._fullLoop && start === 0 && end === count - 1; |
| 256 | return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions); |
| 257 | } |
| 258 | |
| 259 | /** |
| 260 | * @param {Segment[]} segments |
no test coverage detected