0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

🐛 Fix problem when "show in view mode" flag

This commit is contained in:
alonso.torres 2023-04-13 14:16:03 +02:00 committed by Alejandro Alonso
parent 9a695a76ed
commit d127177029

View file

@ -129,6 +129,9 @@
objects (wsh/lookup-page-objects state page-id)
ordered-indexes (cph/order-by-indexed-shapes objects shapes)
parent-id (get-in objects [frame-id :parent-id])
ordered-indexes (->> ordered-indexes (remove #(= % parent-id)))
to-move-shapes (map (d/getf objects) ordered-indexes)
changes
@ -137,9 +140,7 @@
(pcb/with-objects objects)
(cond-> (not (ctl/any-layout? objects frame-id))
(pcb/update-shapes ordered-indexes ctl/remove-layout-item-data))
(pcb/update-shapes ordered-indexes #(cond-> %
(and (cph/frame-shape? %) (not= (:parent-id %) uuid/zero))
(assoc :hide-in-viewer true)))
(pcb/update-shapes ordered-indexes #(cond-> % (cph/frame-shape? %) (assoc :hide-in-viewer true)))
(pcb/change-parent frame-id to-move-shapes 0)
(cond-> (ctl/grid-layout? objects frame-id)
(pcb/update-shapes [frame-id] ctl/assign-cells))))]