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