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

Function setZoom

app.js:1184–1196  ·  view source on GitHub ↗
(newZoom)

Source from the content-addressed store, hash-verified

1182
1183// --- Pan / zoom (Figma-like) ---
1184function setZoom(newZoom) {
1185 const z = clamp(newZoom, 0.5, 3);
1186 zoomFactor = z;
1187 if (zoomSlider) zoomSlider.value = String(Math.round(zoomFactor * 100));
1188 if (zoomInput) zoomInput.value = String(Math.round(zoomFactor * 100));
1189 applyViewportTransform();
1190 if (driverMode === "u8g2") {
1191 // OLED zoom is applied by recomputing integer scale.
1192 updatePreviewSize();
1193 renderElements();
1194 renderLayers();
1195 }
1196}
1197
1198function zoomAtPoint(clientX, clientY, newZoom) {
1199 const wrapper = document.querySelector(".preview-wrapper");

Callers 3

zoomToSelectionFunction · 0.85
zoomAtPointFunction · 0.85
app.jsFile · 0.85

Calls 5

applyViewportTransformFunction · 0.85
updatePreviewSizeFunction · 0.85
renderElementsFunction · 0.85
renderLayersFunction · 0.85
clampFunction · 0.70

Tested by

no test coverage detected