From aec879e9f708685f9acfe193d1c48cba4da35052 Mon Sep 17 00:00:00 2001 From: Navaneeth Pk Date: Wed, 30 Mar 2022 14:49:07 +0530 Subject: [PATCH] Fixes the incorrect offset of widgets while dragging (#2675) --- frontend/src/Editor/Container.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/Editor/Container.jsx b/frontend/src/Editor/Container.jsx index 811bfe5012..0bac6ff30e 100644 --- a/frontend/src/Editor/Container.jsx +++ b/frontend/src/Editor/Container.jsx @@ -178,7 +178,7 @@ export const Container = ({ [left, top] = doSnapToGrid(canvasWidth, left, top); } - left = Math.round((left * 100) / canvasWidth); + left = (left * 100) / canvasWidth; if (item.currentLayout === 'mobile') { componentData.definition.others.showOnDesktop.value = false; @@ -217,7 +217,7 @@ export const Container = ({ // Computing the left offset const leftOffset = nodeBounds.x - canvasBounds.x; - const left = Math.round(convertXToPercentage(leftOffset, canvasWidth)); + const left = convertXToPercentage(leftOffset, canvasWidth); // Computing the top offset const top = nodeBounds.y - canvasBounds.y; @@ -262,7 +262,7 @@ export const Container = ({ height = height + deltaHeight; top = y; - left = Math.round((x * 100) / canvasWidth); + left = (x * 100) / canvasWidth; let newBoxes = { ...boxes,