From f992c740d597c8579a8be1b6cf834ebf0d42e5e3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 16 Oct 2020 07:32:22 +0200 Subject: [PATCH] :bug: Fixed problem with recursive color changes for frames --- frontend/src/app/main/data/colors.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/colors.cljs b/frontend/src/app/main/data/colors.cljs index efc6716bf7..049452a001 100644 --- a/frontend/src/app/main/data/colors.cljs +++ b/frontend/src/app/main/data/colors.cljs @@ -111,7 +111,8 @@ (watch [_ state s] (let [pid (:current-page-id state) objects (get-in state [:workspace-data :pages-index pid :objects]) - children (mapcat #(cph/get-children % objects) ids) + not-frame (fn [shape-id] (not= (get-in objects [shape-id :type]) :frame)) + children (->> ids (filter not-frame) (mapcat #(cph/get-children % objects))) ids (into ids children) is-text? #(= :text (:type (get objects %))) @@ -138,7 +139,8 @@ ptk/WatchEvent (watch [_ state s] (let [objects (get-in state [:workspace-data :pages-index (:current-page-id state) :objects]) - children (mapcat #(cph/get-children % objects) ids) + not-frame (fn [shape-id] (not= (get-in objects [shape-id :type]) :frame)) + children (->> ids (filter not-frame) (mapcat #(cph/get-children % objects))) ids (into ids children) update-fn (fn [s]