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

Function maybeUpdateRectForZooming

external/.scrollLibs.js:3852–3859  ·  view source on GitHub ↗
(measure, rect)

Source from the content-addressed store, hash-verified

3850 // Work around problem with bounding client rects on ranges being
3851 // returned incorrectly when zoomed on IE10 and below.
3852 function maybeUpdateRectForZooming(measure, rect) {
3853 if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) {
3854 return rect
3855 }
3856 var scaleX = screen.logicalXDPI / screen.deviceXDPI
3857 var scaleY = screen.logicalYDPI / screen.deviceYDPI
3858 return { left: rect.left * scaleX, right: rect.right * scaleX, top: rect.top * scaleY, bottom: rect.bottom * scaleY }
3859 }
3860
3861 function clearLineMeasurementCacheFor(lineView) {
3862 if (lineView.measure) {

Callers 1

measureCharInnerFunction · 0.85

Calls 1

hasBadZoomedRectsFunction · 0.85

Tested by

no test coverage detected