MCPcopy Create free account
hub / github.com/microsoft/SandDance / renderTriangle

Method renderTriangle

docs/tests/v2/es6/js/sanddance.js:124958–124972  ·  view source on GitHub ↗
(i, context)

Source from the content-addressed store, hash-verified

124956 }
124957
124958 renderTriangle(i, context) {
124959 const buffer = context == null ? context = new _path.default() : undefined;
124960 const {
124961 points,
124962 triangles
124963 } = this;
124964 const t0 = triangles[i *= 3] * 2;
124965 const t1 = triangles[i + 1] * 2;
124966 const t2 = triangles[i + 2] * 2;
124967 context.moveTo(points[t0], points[t0 + 1]);
124968 context.lineTo(points[t1], points[t1 + 1]);
124969 context.lineTo(points[t2], points[t2 + 1]);
124970 context.closePath();
124971 return buffer && buffer.value();
124972 }
124973
124974 *trianglePolygons() {
124975 const {

Callers 1

trianglePolygonMethod · 0.95

Calls 4

moveToMethod · 0.45
lineToMethod · 0.45
closePathMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected