🎉 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:
Andrey Antukh 2023-05-26 16:37:15 +02:00
parent 9f5640c1db
commit 405aa66357
130 changed files with 3038 additions and 2901 deletions

View file

@ -80,7 +80,7 @@
([state label type props]
(let [page (current-page state)
frame (cph/get-frame (:objects page))
shape (cts/make-shape type {:x 0 :y 0 :width 1 :height 1} props)]
shape (cts/setup-shape (merge {:type type :x 0 :y 0 :width 1 :height 1} props))]
(swap! idmap assoc label (:id shape))
(update state :workspace-data
cp/process-changes