🐛 Fixed problem with recursive color changes for frames

This commit is contained in:
alonso.torres 2020-10-16 07:32:22 +02:00
parent f8abcc1b9c
commit f992c740d5

View file

@ -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]