mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 20:28:32 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
4fad2ab619
59 changed files with 608 additions and 325 deletions
|
@ -382,10 +382,11 @@
|
|||
|
||||
(defn update-group-selrect
|
||||
[group children]
|
||||
(let [shape-center (gco/center-shape group)
|
||||
;; Points for every shape inside the group
|
||||
(let [;; Points for every shape inside the group
|
||||
points (->> children (mapcat :points))
|
||||
|
||||
shape-center (gco/center-points points)
|
||||
|
||||
;; Fixed problem with empty groups. Should not happen (but it does)
|
||||
points (if (empty? points) (:points group) points)
|
||||
|
||||
|
|
|
@ -37,8 +37,10 @@
|
|||
(= type :frame)))
|
||||
|
||||
(defn group-shape?
|
||||
[{:keys [type]}]
|
||||
(= type :group))
|
||||
([objects id]
|
||||
(group-shape? (get objects id)))
|
||||
([{:keys [type]}]
|
||||
(= type :group)))
|
||||
|
||||
(defn mask-shape?
|
||||
[{:keys [type masked-group?]}]
|
||||
|
@ -171,6 +173,25 @@
|
|||
(get objects)
|
||||
(get-frame objects)))))
|
||||
|
||||
(defn get-root-frame
|
||||
[objects shape-id]
|
||||
|
||||
(let [frame-id
|
||||
(if (frame-shape? objects shape-id)
|
||||
shape-id
|
||||
(dm/get-in objects [shape-id :frame-id]))
|
||||
|
||||
frame (get objects frame-id)]
|
||||
(cond
|
||||
(or (root? frame) (nil? frame))
|
||||
nil
|
||||
|
||||
(root-frame? frame)
|
||||
frame
|
||||
|
||||
:else
|
||||
(get-root-frame objects (:frame-id frame)))))
|
||||
|
||||
(defn valid-frame-target?
|
||||
[objects parent-id shape-id]
|
||||
(let [shape (get objects shape-id)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue