MCPcopy Create free account
hub / github.com/devforth/painterro / setPrimitiveToolValue

Function setPrimitiveToolValue

js/utils.js:174–189  ·  view source on GitHub ↗
(value, primitiveTool, method, param)

Source from the content-addressed store, hash-verified

172}
173
174export function setPrimitiveToolValue(value, primitiveTool, method, param) {
175 primitiveTool[method](value);
176 const selector = `[data-id="${param}"]`;
177 const ctl = document.querySelector(selector);
178 console.log(ctl, value);
179
180 if (ctl) {
181 if (method === "setShadowOn") {
182 ctl.setAttribute("data-value", value ? "true" : "false");
183 } else {
184 ctl.value = value;
185 }
186 } else {
187 console.warn(`Control not found: ${selector}`);
188 }
189}

Callers 5

setLineWidthMethod · 0.90
setArrowLengthMethod · 0.90
setEraserWidthMethod · 0.90
setPixelSizeMethod · 0.90
setShadowOnMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…