♻️ Adds new properties to shapes

This commit is contained in:
alonso.torres 2020-05-22 16:45:39 +02:00
parent b5a6d9981d
commit e06d8e754f
20 changed files with 288 additions and 136 deletions

View file

@ -26,9 +26,8 @@
(defn shape-snap-points
[shape]
(let [modified-path (gsh/transform-apply-modifiers shape)
shape-center (gsh/center modified-path)]
(let [shape (gsh/transform-shape shape)
shape-center (gsh/center shape)]
(case (:type shape)
:frame (-> modified-path gsh/shape->rect-shape frame-snap-points)
(:path :curve) (into #{shape-center} (-> modified-path gsh/shape->rect-shape :segments))
(into #{shape-center} (-> modified-path :segments)))))
:frame (-> shape gsh/shape->rect-shape frame-snap-points)
(into #{shape-center} (-> shape :points)))))