From cb705986bdc390308af6cb210ce3cd0d44fc40d5 Mon Sep 17 00:00:00 2001 From: Dmytro Bartieniev Date: Wed, 6 Jan 2021 10:20:48 +0200 Subject: [PATCH] Change units on resizing to pixels --- src/commands/view/SelectComponent.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index bc6157e5b..0e76e6ec1 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -463,14 +463,7 @@ export default { } const { store, selectedHandler, config } = options; - const { - keyHeight, - keyWidth, - autoHeight, - autoWidth, - unitWidth, - unitHeight - } = config; + const { keyHeight, keyWidth, autoHeight, autoWidth } = config; const onlyHeight = ['tc', 'bc'].indexOf(selectedHandler) >= 0; const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler) >= 0; const style = {}; @@ -479,11 +472,11 @@ export default { if (!onlyHeight) { const bodyw = canvas.getBody().offsetWidth; const width = rect.w < bodyw ? rect.w : bodyw; - style[keyWidth] = autoWidth ? 'auto' : `${width}${unitWidth}`; + style[keyWidth] = autoWidth ? 'auto' : `${width}px`; } if (!onlyWidth) { - style[keyHeight] = autoHeight ? 'auto' : `${rect.h}${unitHeight}`; + style[keyHeight] = autoHeight ? 'auto' : `${rect.h}px`; } modelToStyle.addStyle({ ...style, en }, { avoidStore: !store });