File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,15 +132,16 @@ export const PptxSandboxHost = memo(function PptxSandboxHost({
132132 const style = window . getComputedStyle ( container )
133133 const paddingLeft = Number . parseFloat ( style . paddingLeft ) || 0
134134 const paddingTop = Number . parseFloat ( style . paddingTop ) || 0
135+ const previousScrollLeft = container . scrollLeft
136+ const previousScrollTop = container . scrollTop
135137
136138 zoomPercentRef . current = clampedZoom
137139 setZoomPercent ( clampedZoom )
138140 await activeHandleRef . current ?. viewer . setZoom ( clampedZoom )
139141
140142 container . scrollLeft =
141- ( container . scrollLeft + anchorX - paddingLeft ) * ratio + paddingLeft - anchorX
142- container . scrollTop =
143- ( container . scrollTop + anchorY - paddingTop ) * ratio + paddingTop - anchorY
143+ ( previousScrollLeft + anchorX - paddingLeft ) * ratio + paddingLeft - anchorX
144+ container . scrollTop = ( previousScrollTop + anchorY - paddingTop ) * ratio + paddingTop - anchorY
144145 } , [ ] )
145146
146147 const applyZoomFromCenter = useCallback (
You can’t perform that action at this time.
0 commit comments