Skip to content

Commit

Permalink
Factor in frameSize to “default” scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Jul 12, 2024
1 parent e2009a8 commit a56dda1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function Iframe( {
);
defaultView.frameElement.style.setProperty(
'--wp-block-editor-iframe-zoom-out-inset',
inset === 'number' ? `${ inset }px` : inset
inset
);
} else {
documentElement.classList.remove( 'is-zoomed-out' );
Expand Down Expand Up @@ -267,7 +267,9 @@ function Iframe( {
refZoomOutStatus.current.effect = ( isActive, nextWidth ) => {
if ( isActive ) {
const { priorContainerWidth } = refZoomOutStatus.current;
actualizeZoom( nextWidth / priorContainerWidth, frameSize );
nextWidth -= frameSize * 2;
const nextScale = nextWidth / priorContainerWidth;
actualizeZoom( nextScale, `${ frameSize }px` );
clearTimeout( refZoomOutStatus.current.timerId );
refZoomOutStatus.current.timerId = setTimeout( () => {
refZoomOutStatus.current.effect = null;
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function VisualEditor( {
const zoomOutProps = isZoomOutMode
? {
scale: 'default',
frameSize: '48px',
frameSize: 48,
}
: {};

Expand Down

0 comments on commit a56dda1

Please sign in to comment.