From f89ccac56757d203adb22fa83312f74f080f0fc6 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 15 Jul 2022 10:01:42 +0200 Subject: [PATCH] :bug: Fix problems with nested boards --- common/src/app/common/pages/init.cljc | 2 +- .../src/app/main/data/workspace/transforms.cljs | 14 ++++++++++---- .../app/main/ui/workspace/viewport/widgets.cljs | 3 +-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/common/src/app/common/pages/init.cljc b/common/src/app/common/pages/init.cljc index 97e499711..3b1e85b04 100644 --- a/common/src/app/common/pages/init.cljc +++ b/common/src/app/common/pages/init.cljc @@ -71,7 +71,7 @@ :stroke-opacity 1}]} {:type :frame - :name "Artboard-1" + :name "Board-1" :fills [{:fill-color clr/white :fill-opacity 1}] :strokes [] diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 4d87ff0f6..09ec05e42 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -870,13 +870,19 @@ objects (wsh/lookup-page-objects state page-id) frame-id (cph/frame-id-by-position objects position) - moving-shapes (->> ids - (cph/clean-loops objects) - (keep #(get objects %)) - (remove (partial check-frame-move? frame-id objects position))) + moving-shapes + (->> ids + (cph/clean-loops objects) + (keep #(get objects %)) + (remove (partial check-frame-move? frame-id objects position))) + + moving-frames + (->> ids + (filter #(cph/frame-shape? objects %))) changes (-> (pcb/empty-changes it page-id) (pcb/with-objects objects) + (pcb/update-shapes moving-frames (fn [shape] (assoc shape :hide-in-viewer true))) (pcb/change-parent frame-id moving-shapes))] (when-not (empty? changes) diff --git a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs index 68c8f61cf..56725968f 100644 --- a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs @@ -140,8 +140,7 @@ text-pos-x (if (:use-for-thumbnail? frame) 15 0)] (when (not (:hidden frame)) - [:g {:id (dm/str "frame-title-" (:id frame)) - } + [:g {:id (dm/str "frame-title-" (:id frame))} (when (:use-for-thumbnail? frame) [:g {:transform (dm/str frame-transform " " (text-transform label-pos zoom))} [:svg {:x 0