diff --git a/common/src/app/common/geom/shapes.cljc b/common/src/app/common/geom/shapes.cljc index 228a729c98..0de45c4380 100644 --- a/common/src/app/common/geom/shapes.cljc +++ b/common/src/app/common/geom/shapes.cljc @@ -193,10 +193,6 @@ (dm/export gtr/transform-bounds) (dm/export gtr/move-position-data) (dm/export gtr/apply-objects-modifiers) -(dm/export gtr/parent-coords-rect) -(dm/export gtr/parent-coords-points) -(dm/export gtr/apply-modifiers) -(dm/export gtr/apply-transform) ;; Constratins (dm/export gct/calc-child-modifiers) diff --git a/common/src/app/common/types/file.cljc b/common/src/app/common/types/file.cljc index 298f8c0eaa..e6c46edef4 100644 --- a/common/src/app/common/types/file.cljc +++ b/common/src/app/common/types/file.cljc @@ -14,6 +14,7 @@ [app.common.geom.shapes :as gsh] [app.common.pages.common :refer [file-version]] [app.common.pages.helpers :as cph] + [app.common.spec :as us] [app.common.types.color :as ctc] [app.common.types.colors-list :as ctcl] [app.common.types.component :as ctk] diff --git a/frontend/src/app/main/data/workspace/modifiers.cljs b/frontend/src/app/main/data/workspace/modifiers.cljs index 808798457c..1fa029a3b2 100644 --- a/frontend/src/app/main/data/workspace/modifiers.cljs +++ b/frontend/src/app/main/data/workspace/modifiers.cljs @@ -15,6 +15,7 @@ [app.common.pages.helpers :as cph] [app.common.spec :as us] [app.common.types.modifiers :as ctm] + [app.common.types.container :as ctn] [app.common.types.shape :as cts] [app.common.types.shape.layout :as ctl] [app.common.uuid :as uuid] @@ -54,7 +55,7 @@ shape (nil? root) - (cph/get-root-shape objects shape) + (ctn/get-root-shape objects shape) :else root) @@ -64,7 +65,7 @@ transformed-shape (nil? transformed-root) - (as-> (cph/get-root-shape objects transformed-shape) $ + (as-> (ctn/get-root-shape objects transformed-shape) $ (gsh/transform-shape (merge $ (get modif-tree (:id $))))) :else transformed-root) diff --git a/frontend/src/app/main/data/workspace/shapes.cljs b/frontend/src/app/main/data/workspace/shapes.cljs index 95adb579a0..398d6e1083 100644 --- a/frontend/src/app/main/data/workspace/shapes.cljs +++ b/frontend/src/app/main/data/workspace/shapes.cljs @@ -14,6 +14,7 @@ [app.common.pages.helpers :as cph] [app.common.spec :as us] [app.common.types.component :as ctk] + [app.common.types.container :as ctn] [app.common.types.page :as ctp] [app.common.types.shape :as cts] [app.common.types.shape-tree :as ctst] @@ -159,7 +160,7 @@ ;; not the root. In this case, they must not be deleted, ;; but hidden (to be able to recover them more easily). (let [shape (get objects shape-id) - component-shape (cph/get-component-shape objects shape)] + component-shape (ctn/get-component-shape objects shape)] (and (ctk/in-component-instance? shape) (not= shape component-shape) (not (ctk/main-instance? component-shape))))) diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 902a5d080c..afb04988f2 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -14,6 +14,7 @@ [app.common.geom.shapes.flex-layout :as gsl] [app.common.math :as mth] [app.common.pages.changes-builder :as pcb] + [app.common.pages.common :as cpc] [app.common.pages.helpers :as cph] [app.common.spec :as us] [app.common.types.component :as ctk] @@ -51,7 +52,8 @@ (let [children (->> root-shape :shapes (map #(get objects %)) - (map #(gsh/apply-modifiers % (get-in modifiers [(:id %) :modifiers])))) + ;; %% (map #(gsh/apply-modifiers % (get-in modifiers [(:id %) :modifiers]))) + ) root-shape (gsh/update-group-selrect root-shape children)] [(:id root-shape) [root-shape (ctn/get-instances objects root-shape)]]))))] @@ -130,7 +132,8 @@ ] (->> (get-in modifiers [(:id shape) :modifiers]) (process-text-modifiers shape) - (gsh/apply-modifiers shape)))) + ;; %% (gsh/apply-modifiers shape) + ))) main-shapes)] (reduce #(add-copy-modifiers %1 %2 main-root main-shapes main-shapes-modif) modifiers @@ -249,7 +252,8 @@ (contains? (:workspace-layout state) :snap-pixel-grid)) modif-tree - (gsh/set-objects-modifiers ids objects (constantly modifiers) ignore-constraints snap-pixel?) + {} + ;; %% (gsh/set-objects-modifiers ids objects (constantly modifiers) ignore-constraints snap-pixel?) copies (get-copies (mapv (d/getf objects) ids) objects modif-tree) @@ -285,10 +289,11 @@ get-modifier (fn [shape] - (gsh/rotation-modifiers shape center angle)) + (ctm/rotation-modifiers shape center angle)) modif-tree - (gsh/set-objects-modifiers ids objects get-modifier false false)] + {}] + ;;%% (gsh/set-objects-modifiers ids objects get-modifier false false)] (update state :workspace-modifiers merge modif-tree)))))) @@ -672,7 +677,7 @@ (rx/map (fn [[[pos mod?] shift?]] (let [delta-angle (calculate-angle pos mod? shift?)] - (dwm/set-rotation-modifiers delta-angle shapes group-center)))) + (set-rotation-modifiers delta-angle shapes group-center)))) (rx/take-until stoper)) (rx/of (dwm/apply-modifiers) (finish-transform))))))) @@ -688,7 +693,7 @@ objects (wsh/lookup-page-objects state page-id) rotate-shape (fn [shape] (let [delta (- rotation (:rotation shape))] - (dwm/set-rotation-modifiers delta [shape])))] + (set-rotation-modifiers delta [shape])))] (rx/concat (rx/from (->> ids (map #(get objects %)) (map rotate-shape))) (rx/of (dwm/apply-modifiers))))))) diff --git a/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs b/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs index be29339fa8..192c26bac2 100644 --- a/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/frame/dynamic_modifiers.cljs @@ -208,7 +208,8 @@ (let [children (->> root-shape :shapes (map #(get objects %)) - (map #(gsh/apply-modifiers % (get-in modifiers [(:id %) :modifiers])))) + ;; %% (map #(gsh/apply-modifiers % (get-in modifiers [(:id %) :modifiers]))) + ) root-shape (gsh/update-group-selrect root-shape children)] [(:id root-shape) [root-shape (ctn/get-instances objects root-shape)]]))))] @@ -323,7 +324,8 @@ ] (->> (get-in modifiers [(:id shape) :modifiers]) (process-text-modifiers shape) - (gsh/apply-modifiers shape)))) + ;; %% (gsh/apply-modifiers shape) + ))) main-shapes)] (reduce #(add-copy-modifiers %1 %2 main-root main-shapes main-shapes-modif) modifiers