Skip to content

Commit

Permalink
Layout Editor: Elements don't rescale after saving (#2776)
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao authored Oct 22, 2024
1 parent e312c7b commit c28b61c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ui/src/layout-editor/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2821,10 +2821,20 @@ Viewer.prototype.initMoveable = function() {
e.target.style.transform = e.drag.transform;

// If selected object is a widget, get parent instead
const selectedObject = (lD.selectedObject.type == 'widget') ?
let selectedObject = (lD.selectedObject.type == 'widget') ?
lD.selectedObject.parent : lD.selectedObject;

// Update element dimension properties
// If it's an element, we need to get the object from the actual structure
if (selectedObject.type == 'element') {
selectedObject =
lD.getObjectByTypeAndId(
'element',
selectedObject.elementId,
'widget_' + selectedObject.regionId + '_' + selectedObject.widgetId,
);
}

// Update object dimension properties
selectedObject.transform({
width: parseFloat(e.width / self.containerObjectDimensions.scale),
height: parseFloat(e.height / self.containerObjectDimensions.scale),
Expand Down

0 comments on commit c28b61c

Please sign in to comment.