MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / zoomChange

Function zoomChange

src/pages/Workspace/index.jsx:334–348  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

332 zoomChange(127000 / (basicProperty.width || basicWidth))
333 }
334 function zoomChange(value) {
335 // 让iframe 的宽高也改变 作用为当显示不全时显示滚动条
336 const changeWidth = (basicProperty.width || basicWidth) * (value / 100)
337 const changeHeight = (basicProperty.height || basicHeight) * (value / 100)
338 const nowLeft = getElementIdProperty('work-frame', 'left')
339 const nowTop = getElementIdProperty('work-frame', 'left')
340 rulerRef.current.changeRulerLength(changeWidth + nowLeft, changeHeight + nowTop) // 改变标尺的长度
341 iframeRef.current && (iframeRef.current.style.width = `${changeWidth}px`);
342 iframeRef.current && (iframeRef.current.style.height = `${changeHeight}px`);
343 setZoom(value);
344 effectFrame({
345 command: 'zoomChange',
346 property: value,
347 });
348 }
349 function onPropertyChange(fields, type, command) {
350 if (type === 'basic' && (command === 'update' || command === 'upload')) {
351 const tempBasicProperty = JSON.parse(JSON.stringify(basicProperty))

Callers 4

BottomToolsFunction · 0.85
WorkspaceFunction · 0.85
scrollChangeZoomFunction · 0.85
fullScreenFunction · 0.85

Calls 2

getElementIdPropertyFunction · 0.85
effectFrameFunction · 0.85

Tested by

no test coverage detected