MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / hasBadZoomedRects

Function hasBadZoomedRects

lib/web/CodeMirror/src/util/feature_detection.js:78–84  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

76
77let badZoomedRects = null
78export function hasBadZoomedRects(measure) {
79 if (badZoomedRects != null) return badZoomedRects
80 let node = removeChildrenAndAdd(measure, elt("span", "x"))
81 let normal = node.getBoundingClientRect()
82 let fromRange = range(node, 0, 1).getBoundingClientRect()
83 return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
84}

Callers 1

Calls 3

removeChildrenAndAddFunction · 0.90
eltFunction · 0.90
rangeFunction · 0.90

Tested by

no test coverage detected