From 20855fe55cec6adcc69a6e3b44e82af24eea138b Mon Sep 17 00:00:00 2001
From: Pawel Kaczmarczyk
Date: Mon, 22 Jul 2019 12:50:47 +0200
Subject: [PATCH] Fix changing dimensions after dragging element
[Issue] https://github.com/Samsung/TAU-Design-Editor/issues/213
[Problem] Element after dragging has absolute position which
may interfere it's dimensions.
[Solution] Store element width and height before starting
dragging
Signed-off-by: Pawel Kaczmarczyk
---
design-editor/src/pane/interaction.js | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/design-editor/src/pane/interaction.js b/design-editor/src/pane/interaction.js
index e8fa7cee4..818bcc2f9 100644
--- a/design-editor/src/pane/interaction.js
+++ b/design-editor/src/pane/interaction.js
@@ -286,6 +286,13 @@ class Interaction {
height: $contentElement.outerHeight()
};
+ // store element width and height, because of dragging changes
+ // positioning type and element may lost it's dimensions
+ $contentElement.css({
+ 'width': $contentElement.css('width'),
+ 'height': $contentElement.css('height')
+ });
+
$selectLayerParent[0].showHighlighter($contentElement.parent()[0]);
// Make parent offset root if it's not already