diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index 0b86e31ae..b75f13e00 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -263,9 +263,6 @@ parent (get-in page [:objects parent-id]) main-inst (get-in component [:objects (:main-instance-id component)]) inside-component? (some? (ctn/get-instance-root (:objects page) parent)) - origin-frame (get-in page [:objects (:frame-id main-inst)]) - ;; We are using a deleted component andit's coordenates are absolute, we must adjust them to its containing frame to adjust the delta - delta (gpt/subtract delta (-> origin-frame :selrect gpt/point)) shapes (cfh/get-children-with-self (:objects component) (:main-instance-id component)) shapes (map #(gsh/move % delta) shapes) diff --git a/frontend/src/app/main/data/workspace/selection.cljs b/frontend/src/app/main/data/workspace/selection.cljs index eb5e9e168..b4a52c1af 100644 --- a/frontend/src/app/main/data/workspace/selection.cljs +++ b/frontend/src/app/main/data/workspace/selection.cljs @@ -433,6 +433,8 @@ main-component (ctf/get-component libraries file-id component-id) moved-component (gsh/move component-root delta) pos (gpt/point (:x moved-component) (:y moved-component)) + origin-frame (get-in page [:objects frame-id]) + delta (gpt/subtract delta (-> origin-frame :selrect gpt/point)) instantiate-component #(dwlh/generate-instantiate-component changes