diff --git a/frontend/src/app/main/data/workspace/drawing/box.cljs b/frontend/src/app/main/data/workspace/drawing/box.cljs index d6d28dd8b3..7df56e1f05 100644 --- a/frontend/src/app/main/data/workspace/drawing/box.cljs +++ b/frontend/src/app/main/data/workspace/drawing/box.cljs @@ -13,6 +13,7 @@ [app.common.geom.shapes.flex-layout :as gslf] [app.common.geom.shapes.grid-layout :as gslg] [app.common.math :as mth] + [app.common.types.container :as ctn] [app.common.types.modifiers :as ctm] [app.common.types.shape :as cts] [app.common.types.shape-tree :as ctst] @@ -87,7 +88,9 @@ objects (wsh/lookup-page-objects state page-id) focus (:workspace-focus-selected state) - fid (ctst/top-nested-frame objects initial) + fid (->> (ctst/top-nested-frame objects initial) + (ctn/get-first-not-copy-parent objects) ;; We don't want to change the structure of component copies + :id) flex-layout? (ctl/flex-layout? objects fid) grid-layout? (ctl/grid-layout? objects fid) diff --git a/frontend/src/app/main/data/workspace/drawing/curve.cljs b/frontend/src/app/main/data/workspace/drawing/curve.cljs index 0f2ddb675f..d0b1aed44b 100644 --- a/frontend/src/app/main/data/workspace/drawing/curve.cljs +++ b/frontend/src/app/main/data/workspace/drawing/curve.cljs @@ -13,6 +13,7 @@ [app.common.geom.shapes.flex-layout :as gslf] [app.common.geom.shapes.grid-layout :as gslg] [app.common.geom.shapes.path :as gsp] + [app.common.types.container :as ctn] [app.common.types.shape :as cts] [app.common.types.shape-tree :as ctst] [app.common.types.shape.layout :as ctl] @@ -57,7 +58,9 @@ content (dm/get-in state [:workspace-drawing :object :content] []) start (dm/get-in content [0 :params] nil) position (when start (gpt/point start)) - frame-id (ctst/top-nested-frame objects position) + frame-id (->> (ctst/top-nested-frame objects position) + (ctn/get-first-not-copy-parent objects) ;; We don't want to change the structure of component copies + :id) flex-layout? (ctl/flex-layout? objects frame-id) grid-layout? (ctl/grid-layout? objects frame-id) diff --git a/frontend/src/app/main/data/workspace/path/drawing.cljs b/frontend/src/app/main/data/workspace/path/drawing.cljs index 4d42815234..12f3b8653a 100644 --- a/frontend/src/app/main/data/workspace/path/drawing.cljs +++ b/frontend/src/app/main/data/workspace/path/drawing.cljs @@ -11,6 +11,7 @@ [app.common.geom.shapes.flex-layout :as gsl] [app.common.path.commands :as upc] [app.common.path.shapes-to-path :as upsp] + [app.common.types.container :as ctn] [app.common.types.shape :as cts] [app.common.types.shape-tree :as ctst] [app.common.types.shape.layout :as ctl] @@ -242,7 +243,9 @@ (let [objects (wsh/lookup-page-objects state) content (get-in state [:workspace-drawing :object :content] []) position (gpt/point (get-in content [0 :params] nil)) - frame-id (ctst/top-nested-frame objects position) + frame-id (->> (ctst/top-nested-frame objects position) + (ctn/get-first-not-copy-parent objects) ;; We don't want to change the structure of component copies + :id) flex-layout? (ctl/flex-layout? objects frame-id) drop-index (when flex-layout? (gsl/get-drop-index frame-id objects position))]