MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / updateZoom

Function updateZoom

scripts/magnify_image.js:915–921  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

913 }
914
915 function updateZoom() {
916 if (img.naturalWidth && img.naturalHeight) {
917 let zoom = (parseFloat(img.style.width) / img.naturalWidth).toFixed(1);
918 if (parseInt(zoom) == zoom) zoom = parseInt(zoom);
919 zoomEle.innerText = `${zoom}x`;
920 }
921 }
922
923 const { destroy, animateTo } = enableDragAndZoom(
924 img,

Callers 1

createPreviewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected