MCPcopy Index your code
hub / github.com/clips/pattern / triangle

Function triangle

pattern/canvas.js:1965–1979  ·  view source on GitHub ↗
(x1, y1, x2, y2, x3, y3, options)

Source from the content-addressed store, hash-verified

1963}
1964
1965function triangle(x1, y1, x2, y2, x3, y3, options) {
1966 /* Draws the triangle created by connecting the three given points.
1967 * The current stroke, strokewidth, strokestyle and fill color are applied.
1968 */
1969 var a = _colorMixin(options);
1970 if (a[0] && a[0].a > 0 || a[1] && a[1].a > 0) {
1971 _ctx.beginPath();
1972 _ctx.moveTo(x1, y1);
1973 _ctx.lineTo(x2, y2);
1974 _ctx.lineTo(x3, y3);
1975 _ctx.closePath();
1976 _ctx_fill(a[0]);
1977 _ctx_stroke(a[1], a[2], a[3], a[4]);
1978 }
1979}
1980
1981function ellipse(x, y, width, height, options) {
1982 /* Draws an ellipse with the center located at x, y.

Callers

nothing calls this directly

Calls 3

_colorMixinFunction · 0.85
_ctx_fillFunction · 0.85
_ctx_strokeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…