mirror of
https://github.com/penpot/penpot.git
synced 2025-05-17 23:26:10 +02:00
🎉 Add new shape & rect data structures
Also optimizes some functions for faster shape and rect props access (there is still a lot of work ahead optimizing the rest of the functions) Also normalizes shape creation and validation for ensuring correct setup of all the mandatory properties.
This commit is contained in:
parent
9f5640c1db
commit
405aa66357
130 changed files with 3038 additions and 2901 deletions
|
@ -162,18 +162,18 @@
|
|||
frames (filter cph/frame-shape? (vals objects))]
|
||||
|
||||
(if-let [frame (-> frames first)]
|
||||
(let [frame-id (:id frame)
|
||||
(let [frame-id (:id frame)
|
||||
object-id (str page-id frame-id)
|
||||
frame (if-let [thumb (get thumbnails object-id)]
|
||||
(assoc frame :thumbnail thumb :shapes [])
|
||||
(dissoc frame :thumbnail))
|
||||
frame (if-let [thumb (get thumbnails object-id)]
|
||||
(assoc frame :thumbnail thumb :shapes [])
|
||||
(dissoc frame :thumbnail))
|
||||
|
||||
children-ids
|
||||
(cph/get-children-ids objects frame-id)
|
||||
|
||||
bounds
|
||||
(when (:show-content frame)
|
||||
(gsh/selection-rect (concat [frame] (->> children-ids (map (d/getf objects))))))
|
||||
(gsh/shapes->rect (cons frame (map (d/getf objects) children-ids))))
|
||||
|
||||
frame
|
||||
(cond-> frame
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue