MCPcopy Create free account
hub / github.com/TruthHun/BookStack / maybeUpdateRectForZooming

Function maybeUpdateRectForZooming

static/mergely/lib/codemirror.js:2742–2750  ·  view source on GitHub ↗
(measure, rect)

Source from the content-addressed store, hash-verified

2740 // Work around problem with bounding client rects on ranges being
2741 // returned incorrectly when zoomed on IE10 and below.
2742 function maybeUpdateRectForZooming(measure, rect) {
2743 if (!window.screen || screen.logicalXDPI == null ||
2744 screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
2745 return rect;
2746 var scaleX = screen.logicalXDPI / screen.deviceXDPI;
2747 var scaleY = screen.logicalYDPI / screen.deviceYDPI;
2748 return {left: rect.left * scaleX, right: rect.right * scaleX,
2749 top: rect.top * scaleY, bottom: rect.bottom * scaleY};
2750 }
2751
2752 function clearLineMeasurementCacheFor(lineView) {
2753 if (lineView.measure) {

Callers 1

measureCharInnerFunction · 0.70

Calls 1

hasBadZoomedRectsFunction · 0.70

Tested by

no test coverage detected