From 09353907612910e9e722da797f040e9896c133ca Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 10 Apr 2024 10:27:46 +0200 Subject: [PATCH] :bug: Fix problem with paste order --- common/src/app/common/types/shape/layout.cljc | 8 +++++--- frontend/src/app/main/data/workspace.cljs | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/types/shape/layout.cljc b/common/src/app/common/types/shape/layout.cljc index efccf250c..d6c1178bd 100644 --- a/common/src/app/common/types/shape/layout.cljc +++ b/common/src/app/common/types/shape/layout.cljc @@ -495,9 +495,11 @@ (= layout-align-items :stretch)) (defn reverse? - [{:keys [layout-flex-dir]}] - (or (= :row-reverse layout-flex-dir) - (= :column-reverse layout-flex-dir))) + ([objects id] + (reverse? (get objects id))) + ([{:keys [layout-flex-dir]}] + (or (= :row-reverse layout-flex-dir) + (= :column-reverse layout-flex-dir)))) (defn space-between? [{:keys [layout-justify-content]}] diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 91a080b71..23e8dd546 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -2013,6 +2013,7 @@ (d/index-by :prev-id)) selected (:selected pdata) + objects (:objects pdata) position (deref ms/mouse-position) @@ -2036,6 +2037,10 @@ index 0) + selected (if (and (ctl/flex-layout? page-objects parent-id) (not (ctl/reverse? page-objects parent-id))) + (into (d/ordered-set) (reverse selected)) + selected) + objects (update-vals objects (partial process-shape file-id frame-id parent-id)) all-objects (merge page-objects objects)