MCPcopy Index your code
hub / github.com/hoothin/UserScripts / visualLength

Function visualLength

Picviewer CE+/dist.user.js:13478–13487  ·  view source on GitHub ↗
(str,size,family)

Source from the content-addressed store, hash-verified

13476 rulerEle.style.whiteSpace = "nowrap";
13477 }
13478 function visualLength(str,size,family) {
13479 if (!rulerEle.style) return 230;
13480 rulerEle.style.fontSize = size || "inherit";
13481 rulerEle.style.fontFamily = family || "inherit";
13482 rulerEle.innerText = str;
13483 getBody(document).appendChild(rulerEle);
13484 let w = rulerEle.offsetWidth;
13485 getBody(document).removeChild(rulerEle);
13486 return w;
13487 }
13488
13489 function getMStr(func) {
13490 var lines = func.toString();

Callers 1

initFunction · 0.70

Calls 1

getBodyFunction · 0.70

Tested by

no test coverage detected