MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / applyViewportTransform

Function applyViewportTransform

app.js:227–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225}
226
227function applyViewportTransform() {
228 if (!previewViewport) return;
229 // OLED zoom is applied via integer `scale` in updatePreviewSize (pixel-perfect).
230 const z = driverMode === "u8g2" ? 1 : clamp(zoomFactor || 1, 0.5, 3);
231 previewViewport.style.transform = `translate(${viewportPanX}px, ${viewportPanY}px) scale(${z})`;
232 try { ensureRulers(); } catch (_) {}
233}
234
235function updateCanvasCursorClass() {
236 if (!previewWrapper) previewWrapper = document.querySelector(".preview-wrapper");

Callers 5

zoomToSelectionFunction · 0.85
setZoomFunction · 0.85
zoomAtPointFunction · 0.85
app.jsFile · 0.85
updatePreviewSizeFunction · 0.85

Calls 2

ensureRulersFunction · 0.85
clampFunction · 0.70

Tested by

no test coverage detected