mirror of
https://github.com/penpot/penpot.git
synced 2025-06-12 20:31:39 +02:00
🐛 Fix touched fixer
This commit is contained in:
parent
f004aa5efd
commit
973affb259
1 changed files with 17 additions and 4 deletions
|
@ -358,11 +358,24 @@
|
||||||
(println " -> set touched " (:name shape) (:id shape) attr group))
|
(println " -> set touched " (:name shape) (:id shape) attr group))
|
||||||
(cond-> shape
|
(cond-> shape
|
||||||
(and (not equal?) (not (cph/touched-group? shape group)))
|
(and (not equal?) (not (cph/touched-group? shape group)))
|
||||||
(update :touched cph/set-touched-group group)))))]
|
(update :touched cph/set-touched-group group)))))
|
||||||
|
|
||||||
|
fix-touched-children
|
||||||
|
(fn [shape]
|
||||||
|
(let [matches? (fn [[child-id ref-child-id]]
|
||||||
|
(let [child (ctn/get-shape page child-id)]
|
||||||
|
(= (:shape-ref child) ref-child-id)))
|
||||||
|
equal? (every? matches? (d/zip (:shapes shape) (:shapes ref-shape)))]
|
||||||
|
(when (and (not equal?) (not (cph/touched-group? shape :shapes)))
|
||||||
|
(println " -> set touched " (:name shape) (:id shape) :shapes :shapes-group))
|
||||||
|
(cond-> shape
|
||||||
|
(and (not equal?) (not (cph/touched-group? shape :shapes-group)))
|
||||||
|
(update :touched cph/set-touched-group :shapes-group))))]
|
||||||
|
|
||||||
|
(as-> shape $
|
||||||
|
(reduce fix-touched-attr $ ctk/sync-attrs)
|
||||||
|
(fix-touched-children $)))
|
||||||
|
|
||||||
(reduce fix-touched-attr
|
|
||||||
shape
|
|
||||||
(assoc ctk/sync-attrs :shapes :shapes-group)))
|
|
||||||
shape))
|
shape))
|
||||||
|
|
||||||
update-page (fn [page]
|
update-page (fn [page]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue