mirror of
https://github.com/penpot/penpot.git
synced 2025-05-17 15:26:10 +02:00
✨ Paste on position in grid
This commit is contained in:
parent
714b2c8805
commit
0e152bb7f9
2 changed files with 26 additions and 4 deletions
|
@ -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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue