MCPcopy
hub / github.com/methodofaction/Method-Draw / createBackground

Function createBackground

src/js/method-draw.js:155–173  ·  view source on GitHub ↗
(fill)

Source from the content-addressed store, hash-verified

153 }
154
155 var createBackground = function(fill) {
156 svgCanvas.createLayer("background")
157 cur_shape = svgCanvas.addSvgElementFromJson({
158 "element": "rect",
159 "attr": {
160 "x": -1,
161 "y": -1,
162 "width": res.w+2,
163 "height": res.h+2,
164 "stroke": "none",
165 "id": "canvas_background",
166 "opacity": 1,
167 "fill": fill || "#fff",
168 "style": "pointer-events:none"
169 }
170 });
171 svgCanvas.setCurrentLayer("Layer 1")
172 svgCanvas.setCurrentLayerPosition("1")
173 }
174
175 // create a new layer background if it doesn't exist
176 if (!document.getElementById('canvas_background')) createBackground();

Callers 3

method-draw.jsFile · 0.85
clickClearFunction · 0.85
PaintBoxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected