From 7dee6eeaff30986c97206a115b6a01b9510f3240 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 27 Aug 2019 00:32:22 +0200 Subject: [PATCH] Fix image resize issue. Closes #2002 --- src/commands/view/SelectComponent.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index 154a5d33e4..d69d8b7fdc 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -455,12 +455,8 @@ export default { const style = modelToStyle.getStyle(); if (!onlyHeight) { - const padding = 10; - const frameOffset = canvas.getCanvasView().getFrameOffset(); - const width = - rect.w < frameOffset.width - padding - ? rect.w - : frameOffset.width - padding; + const bodyw = canvas.getBody().offsetWidth; + const width = rect.w < bodyw ? rect.w : bodyw; style[keyWidth] = autoWidth ? 'auto' : `${width}${unitWidth}`; }