MCPcopy Create free account
hub / github.com/breck7/scroll / hasBadZoomedRects

Function hasBadZoomedRects

external/.scrollLibs.js:2167–2175  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

2165
2166 var badZoomedRects = null
2167 function hasBadZoomedRects(measure) {
2168 if (badZoomedRects != null) {
2169 return badZoomedRects
2170 }
2171 var node = removeChildrenAndAdd(measure, elt("span", "x"))
2172 var normal = node.getBoundingClientRect()
2173 var fromRange = range(node, 0, 1).getBoundingClientRect()
2174 return (badZoomedRects = Math.abs(normal.left - fromRange.left) > 1)
2175 }
2176
2177 // Known modes, by name and by MIME
2178 var modes = {},

Callers 1

Calls 3

removeChildrenAndAddFunction · 0.85
eltFunction · 0.85
rangeFunction · 0.85

Tested by

no test coverage detected