Skip to content

Commit

Permalink
Updates to use default args for width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave authored and retrofox committed Aug 2, 2019
1 parent 2cc1264 commit 3ad0bc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/block-editor/src/components/block-preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function BlockPreview( { blocks, settings, srcWidth, srcHeight } ) {

// Fallback dimensions.
const [ previewDimensions, setPreviewDimensions ] = useState( {
width: 400,
height: 300,
width: srcWidth,
height: srcHeight,
transform: 'scale(1)',
} );

Expand All @@ -43,8 +43,8 @@ export function BlockPreview( { blocks, settings, srcWidth, srcHeight } ) {
const scale = Math.min( destWidth / srcWidth ) || 1;

setPreviewDimensions( {
width: srcWidth ? srcWidth : 400 + 'px', // 400x300 is provided as a 4:3 aspect ratio fallback.
height: srcHeight ? srcHeight : 300 + 'px',
width: `${ srcWidth }px`, // 400x300 is provided as a 4:3 aspect ratio fallback.
height: `${ srcHeight }px`,
transform: 'scale(' + scale + ')',
} );

Expand Down

0 comments on commit 3ad0bc1

Please sign in to comment.