mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 07:48:21 +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
|
@ -49,13 +49,11 @@
|
|||
(fn [file-data]
|
||||
(let [frame-id (get props :frame-id uuid/zero)
|
||||
parent-id (get props :parent-id uuid/zero)
|
||||
shape (if (= type :group)
|
||||
(cts/make-minimal-group frame-id
|
||||
{:x 0 :y 0 :width 1 :height 1}
|
||||
(get props :name "Group1"))
|
||||
(cts/make-shape type
|
||||
{:x 0 :y 0 :width 1 :height 1}
|
||||
props))]
|
||||
shape (cts/setup-shape
|
||||
(-> {:type type
|
||||
:width 1
|
||||
:height 1}
|
||||
(merge props)))]
|
||||
|
||||
(swap! idmap assoc label (:id shape))
|
||||
(ctpl/update-page file-data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue