0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

💄 Cosmetic changes on initial align shape event.

This commit is contained in:
Andrey Antukh 2019-08-24 12:40:45 +02:00
parent 4df8a6b3b7
commit eebd56d738

View file

@ -582,7 +582,10 @@
;; --- Shape Transformations ;; --- Shape Transformations
(defrecord InitialShapeAlign [id] (defn initial-shape-align
[id]
{:pre [(uuid? id)]}
(reify
ptk/WatchEvent ptk/WatchEvent
(watch [_ state s] (watch [_ state s]
(let [{:keys [x1 y1] :as shape} (->> (get-in state [:shapes id]) (let [{:keys [x1 y1] :as shape} (->> (get-in state [:shapes id])
@ -590,12 +593,8 @@
point (gpt/point x1 y1)] point (gpt/point x1 y1)]
(->> (uwrk/align-point point) (->> (uwrk/align-point point)
(rx/map (fn [{:keys [x y] :as pt}] (rx/map (fn [{:keys [x y] :as pt}]
(apply-temporal-displacement id (gpt/subtract pt point)))))))) (apply-temporal-displacement id (gpt/subtract pt point)))))))))
(defn initial-shape-align
[id]
{:pre [(uuid? id)]}
(InitialShapeAlign. id))
;; --- Apply Temporal Displacement ;; --- Apply Temporal Displacement