mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05:00
🐛 Fix problem with masks
This commit is contained in:
parent
1f712c82bf
commit
d0244e0bef
1 changed files with 7 additions and 7 deletions
|
@ -31,13 +31,13 @@
|
||||||
(create-bounds shape bounds-map objects modif-tree nil))
|
(create-bounds shape bounds-map objects modif-tree nil))
|
||||||
|
|
||||||
([{:keys [id] :as shape} bounds-map objects modif-tree current-ref]
|
([{:keys [id] :as shape} bounds-map objects modif-tree current-ref]
|
||||||
(cond
|
(if (cfh/group-shape? shape)
|
||||||
(and (cfh/mask-shape? shape) (d/not-empty? (:shapes shape)))
|
|
||||||
(create-bounds (get objects (first (:shapes shape))) bounds-map objects modif-tree)
|
|
||||||
|
|
||||||
(cfh/group-shape? shape)
|
|
||||||
(let [modifiers (dm/get-in modif-tree [id :modifiers])
|
(let [modifiers (dm/get-in modif-tree [id :modifiers])
|
||||||
children (cfh/get-immediate-children objects id)
|
|
||||||
|
children
|
||||||
|
(cond->> (cfh/get-immediate-children objects id)
|
||||||
|
(cfh/mask-shape? shape)
|
||||||
|
(take 1))
|
||||||
shape-bounds (if current-ref @current-ref @(get bounds-map id))
|
shape-bounds (if current-ref @current-ref @(get bounds-map id))
|
||||||
current-bounds
|
current-bounds
|
||||||
(cond-> shape-bounds
|
(cond-> shape-bounds
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
(mapv #(deref (get bounds-map (:id %)))))]
|
(mapv #(deref (get bounds-map (:id %)))))]
|
||||||
(gpo/merge-parent-coords-bounds children-bounds current-bounds))
|
(gpo/merge-parent-coords-bounds children-bounds current-bounds))
|
||||||
|
|
||||||
:else
|
;; Shape
|
||||||
(let [modifiers (dm/get-in modif-tree [id :modifiers])
|
(let [modifiers (dm/get-in modif-tree [id :modifiers])
|
||||||
shape-bounds (if current-ref @current-ref @(get bounds-map id))]
|
shape-bounds (if current-ref @current-ref @(get bounds-map id))]
|
||||||
(cond-> shape-bounds
|
(cond-> shape-bounds
|
||||||
|
|
Loading…
Add table
Reference in a new issue