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

Function rect

pattern/canvas.js:1945–1963  ·  view source on GitHub ↗
(x, y, width, height, options)

Source from the content-addressed store, hash-verified

1943}
1944
1945function rect(x, y, width, height, options) {
1946 /* Draws a rectangle with the top left corner at x, y.
1947 * The current stroke, strokewidth, strokestyle and fill color are applied.
1948 */
1949 // It is faster to do it directly without creating a Path:
1950 var a = _colorMixin(options);
1951 if (a[0] && a[0].a > 0 || a[1] && a[1].a > 0) {
1952 if (!options || options.roundness === undefined) {
1953 _ctx.beginPath();
1954 _ctx.rect(x, y, width, height);
1955 _ctx_fill(a[0]);
1956 _ctx_stroke(a[1], a[2], a[3], a[4]);
1957 } else {
1958 var p = new Path();
1959 p.rect(x, y, width, height, options);
1960 p.draw(options);
1961 }
1962 }
1963}
1964
1965function triangle(x1, y1, x2, y2, x3, y3, options) {
1966 /* Draws the triangle created by connecting the three given points.

Callers 1

solidFunction · 0.85

Calls 4

_colorMixinFunction · 0.85
_ctx_fillFunction · 0.85
_ctx_strokeFunction · 0.85
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…