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

Function line

pattern/canvas.js:1931–1943  ·  view source on GitHub ↗
(x0, y0, x1, y1, options)

Source from the content-addressed store, hash-verified

1929/*--- DRAWING PRIMITIVES ---------------------------------------------------------------------------*/
1930
1931function line(x0, y0, x1, y1, options) {
1932 /* Draws a straight line from x0, y0 to x1, y1.
1933 * The current stroke, strokewidth and strokestyle are applied.
1934 */
1935 // It is faster to do it directly without creating a Path:
1936 var a = _colorMixin(options);
1937 if (a[1] && a[1].a > 0) {
1938 _ctx.beginPath();
1939 _ctx.moveTo(x0, y0);
1940 _ctx.lineTo(x1, y1);
1941 _ctx_stroke(a[1], a[2], a[3], a[4]);
1942 }
1943}
1944
1945function rect(x, y, width, height, options) {
1946 /* Draws a rectangle with the top left corner at x, y.

Callers

nothing calls this directly

Calls 2

_colorMixinFunction · 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…