MCPcopy Create free account
hub / github.com/breck7/scroll / _renderSegment

Method _renderSegment

external/.d3.js:7676–7687  ·  view source on GitHub ↗
(x0, y0, x1, y1, context)

Source from the content-addressed store, hash-verified

7674 return polygon.value();
7675 }
7676 _renderSegment(x0, y0, x1, y1, context) {
7677 let S;
7678 const c0 = this._regioncode(x0, y0);
7679 const c1 = this._regioncode(x1, y1);
7680 if (c0 === 0 && c1 === 0) {
7681 context.moveTo(x0, y0);
7682 context.lineTo(x1, y1);
7683 } else if (S = this._clipSegment(x0, y0, x1, y1, c0, c1)) {
7684 context.moveTo(S[0], S[1]);
7685 context.lineTo(S[2], S[3]);
7686 }
7687 }
7688 contains(i, x, y) {
7689 if ((x = +x, x !== x) || (y = +y, y !== y)) return false;
7690 return this.delaunay._step(i, x, y) === i;

Callers 1

renderMethod · 0.95

Calls 4

_regioncodeMethod · 0.95
_clipSegmentMethod · 0.95
moveToMethod · 0.45
lineToMethod · 0.45

Tested by

no test coverage detected