MCPcopy Index your code
hub / github.com/shipshapecode/tether / offsetToPx

Function offsetToPx

src/js/utils/offset.js:70–79  ·  view source on GitHub ↗
(offset, size)

Source from the content-addressed store, hash-verified

68}
69
70export function offsetToPx(offset, size) {
71 if (isString(offset.left) && offset.left.indexOf('%') !== -1) {
72 offset.left = parseFloat(offset.left) / 100 * size.width;
73 }
74 if (isString(offset.top) && offset.top.indexOf('%') !== -1) {
75 offset.top = parseFloat(offset.top) / 100 * size.height;
76 }
77
78 return offset;
79}
80
81export function parseTopLeft(value) {
82 const [top, left] = value.split(' ');

Callers 2

offset.spec.jsFile · 0.90
positionMethod · 0.90

Calls 1

isStringFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…