mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 12:56:11 +02:00
⚡ Improve performance on creating component from graphic
About 25% speed improvement on average on single file migration process
This commit is contained in:
parent
c70acb1570
commit
f104cc5477
5 changed files with 148 additions and 115 deletions
|
@ -72,13 +72,15 @@
|
|||
(watch [it state _]
|
||||
(let [page-id (:current-page-id state)
|
||||
objects (wsh/lookup-page-objects state page-id)
|
||||
shapes (->> shapes (remove #(dm/get-in objects [% :blocked])))
|
||||
shapes (->> shapes
|
||||
(remove #(dm/get-in objects [% :blocked]))
|
||||
(cfh/order-by-indexed-shapes objects))
|
||||
|
||||
changes (-> (pcb/empty-changes it page-id)
|
||||
(pcb/with-objects objects))
|
||||
changes (cfsh/prepare-move-shapes-into-frame changes
|
||||
frame-id
|
||||
shapes
|
||||
objects)]
|
||||
|
||||
changes (cfsh/prepare-move-shapes-into-frame changes frame-id shapes objects)]
|
||||
|
||||
(if (some? changes)
|
||||
(rx/of (dch/commit-changes changes))
|
||||
(rx/empty))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue