Skip to content

Commit

Permalink
Merge pull request #2158 from microsoft/u/juliaroldi/remove-height
Browse files Browse the repository at this point in the history
Remove max-height when paste image
  • Loading branch information
juliaroldi authored Oct 20, 2023
2 parents 6803528 + 70919af commit 2ec40f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,10 @@ function handleImages(editor: IContentModelEditor, context: FormatWithContentMod
if (context.newImages.length > 0) {
const viewport = editor.getVisibleViewport();
if (viewport) {
const { top, bottom, left, right } = viewport;
const { left, right } = viewport;
const minMaxImageSize = 10;
const maxWidth = Math.max(right - left, minMaxImageSize);
const maxHeight = Math.max(bottom - top, minMaxImageSize);
context.newImages.forEach(image => {
image.format.maxHeight = `${maxHeight}px`;
image.format.maxWidth = `${maxWidth}px`;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ describe(ID, () => {
src: 'https://github.com/microsoft/roosterjs',
format: {
maxWidth: '100px',
maxHeight: '100px',
},
dataset: {},
},
Expand Down

0 comments on commit 2ec40f1

Please sign in to comment.