Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Alejandro Alonso 2023-03-24 12:33:14 +01:00
commit 4fad2ab619
59 changed files with 608 additions and 325 deletions

View file

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

View file

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