Paste on position in grid

This commit is contained in:
alonso.torres 2023-05-22 15:34:01 +02:00
parent 714b2c8805
commit 0e152bb7f9
2 changed files with 26 additions and 4 deletions

View file

@ -994,3 +994,18 @@
(-> parent
(assoc-in [:layout-grid-cells id-from :shapes] (dm/get-in parent [:layout-grid-cells id-to :shapes]))
(assoc-in [:layout-grid-cells id-to :shapes] (dm/get-in parent [:layout-grid-cells id-from :shapes]))))
(defn add-children-to-cell
[frame children objects [row column :as cell]]
(let [;; Temporary remove the children when moving them
frame (-> frame
(update :shapes #(d/removev children %))
(assign-cells))
children (->> children (remove #(layout-absolute? objects %)))]
(-> frame
(update :shapes d/concat-vec children)
(cond-> (some? cell)
(push-into-cell children row column))
(assign-cells))))