mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 17:36:13 +02:00
✨ Set an artboard as the file thumbnail
This commit is contained in:
parent
a588267fc2
commit
0a04a856da
11 changed files with 150 additions and 26 deletions
|
@ -71,9 +71,10 @@
|
|||
(update :undo-changes conj (assoc change :operations uops)))))
|
||||
|
||||
(defn update-shapes
|
||||
([ids f] (update-shapes ids f nil))
|
||||
([ids f {:keys [reg-objects? save-undo? attrs ignore-tree]
|
||||
:or {reg-objects? false save-undo? true attrs nil}}]
|
||||
([ids f] (update-shapes ids f nil nil))
|
||||
([ids f keys] (update-shapes ids f nil keys))
|
||||
([ids f page-id {:keys [reg-objects? save-undo? attrs ignore-tree]
|
||||
:or {reg-objects? false save-undo? true attrs nil}}]
|
||||
|
||||
(us/assert ::coll-of-uuid ids)
|
||||
(us/assert fn? f)
|
||||
|
@ -81,8 +82,8 @@
|
|||
(ptk/reify ::update-shapes
|
||||
ptk/WatchEvent
|
||||
(watch [it state _]
|
||||
(let [page-id (:current-page-id state)
|
||||
objects (wsh/lookup-page-objects state)
|
||||
(let [page-id (or page-id (:current-page-id state))
|
||||
objects (wsh/lookup-page-objects state page-id)
|
||||
changes {:redo-changes []
|
||||
:undo-changes []
|
||||
:origin it
|
||||
|
@ -91,8 +92,8 @@
|
|||
ids (into [] (filter some?) ids)
|
||||
|
||||
changes (reduce
|
||||
#(update-shape-changes %1 page-id objects f attrs %2 (get ignore-tree %2))
|
||||
changes ids)]
|
||||
#(update-shape-changes %1 page-id objects f attrs %2 (get ignore-tree %2))
|
||||
changes ids)]
|
||||
|
||||
(when-not (empty? (:redo-changes changes))
|
||||
(let [reg-objs {:type :reg-objects
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue