MCPcopy Create free account
hub / github.com/rough-stuff/wired-elements / rectangle

Method rectangle

packages/wired-lib/wired-lib.js:27–39  ·  view source on GitHub ↗
(svg, x, y, width, height)

Source from the content-addressed store, hash-verified

25 }
26
27 rectangle(svg, x, y, width, height) {
28 x = x + 2;
29 y = y + 2;
30 width = width - 4;
31 height = height - 4;
32 let path = this._line(x, y, x + width, y);
33 path = this._line(x + width, y, x + width, y + height, path);
34 path = this._line(x + width, y + height, x, y + height, path);
35 path = this._line(x, y + height, x, y, path);
36 const node = this._svgNode("path", { d: path.value })
37 svg.appendChild(node);
38 return node;
39 }
40
41 polygon(svg, vertices) {
42 let path = null;

Callers 9

_didRenderMethod · 0.80
_didRenderMethod · 0.80
_didRenderMethod · 0.80
_didRenderMethod · 0.80
_didRenderMethod · 0.80
_didRenderMethod · 0.80
_didRenderMethod · 0.80
_didRenderMethod · 0.80
_didRenderMethod · 0.80

Calls 2

_lineMethod · 0.95
_svgNodeMethod · 0.95

Tested by

no test coverage detected