mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 01:11:41 +02:00
Minor cosmetic changes on shapes events.
This commit is contained in:
parent
25f634352d
commit
cda2737b02
1 changed files with 10 additions and 11 deletions
|
@ -490,7 +490,7 @@
|
||||||
|
|
||||||
;; --- Update Interaction
|
;; --- Update Interaction
|
||||||
|
|
||||||
(defrecord UpdateInteraction [shape interaction]
|
(deftype UpdateInteraction [shape interaction]
|
||||||
udp/IPageUpdate
|
udp/IPageUpdate
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
|
@ -505,7 +505,7 @@
|
||||||
|
|
||||||
;; --- Delete Interaction
|
;; --- Delete Interaction
|
||||||
|
|
||||||
(defrecord DeleteInteracton [shape id]
|
(deftype DeleteInteracton [shape id]
|
||||||
udp/IPageUpdate
|
udp/IPageUpdate
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
|
@ -518,7 +518,7 @@
|
||||||
|
|
||||||
;; --- Path Modifications
|
;; --- Path Modifications
|
||||||
|
|
||||||
(defrecord UpdatePath [id index delta]
|
(deftype UpdatePath [id index delta]
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(update-in state [:shapes id :points index] gpt/add delta)))
|
(update-in state [:shapes id :points index] gpt/add delta)))
|
||||||
|
@ -529,7 +529,7 @@
|
||||||
{:pre [(uuid? id) (number? index) (gpt/point? delta)]}
|
{:pre [(uuid? id) (number? index) (gpt/point? delta)]}
|
||||||
(UpdatePath. id index delta))
|
(UpdatePath. id index delta))
|
||||||
|
|
||||||
(defrecord InitialPathPointAlign [id index]
|
(deftype InitialPathPointAlign [id index]
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state s]
|
(watch [_ state s]
|
||||||
(let [shape (get-in state [:shapes id])
|
(let [shape (get-in state [:shapes id])
|
||||||
|
@ -550,7 +550,7 @@
|
||||||
|
|
||||||
;; --- Start shape "edition mode"
|
;; --- Start shape "edition mode"
|
||||||
|
|
||||||
(defrecord StartEditionMode [id]
|
(deftype StartEditionMode [id]
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(assoc-in state [:workspace :edition] id))
|
(assoc-in state [:workspace :edition] id))
|
||||||
|
@ -566,7 +566,7 @@
|
||||||
|
|
||||||
;; --- Events (implicit) (for selected)
|
;; --- Events (implicit) (for selected)
|
||||||
|
|
||||||
(defrecord DeselectAll []
|
(deftype DeselectAll []
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(-> state
|
(-> state
|
||||||
|
@ -635,10 +635,10 @@
|
||||||
[opts]
|
[opts]
|
||||||
(reify
|
(reify
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state s]
|
(watch [_ state stream]
|
||||||
(rx/from-coll
|
|
||||||
(->> (get-in state [:workspace :selected])
|
(->> (get-in state [:workspace :selected])
|
||||||
(map #(update-fill-attrs % opts)))))))
|
(map #(update-fill-attrs % opts))
|
||||||
|
(rx/from-coll)))))
|
||||||
|
|
||||||
(defn update-selected-shapes-stroke
|
(defn update-selected-shapes-stroke
|
||||||
"Update the fill related attributed on
|
"Update the fill related attributed on
|
||||||
|
@ -651,7 +651,6 @@
|
||||||
(->> (get-in state [:workspace :selected])
|
(->> (get-in state [:workspace :selected])
|
||||||
(map #(update-stroke-attrs % opts)))))))
|
(map #(update-stroke-attrs % opts)))))))
|
||||||
|
|
||||||
|
|
||||||
;; --- Move Selected Layer
|
;; --- Move Selected Layer
|
||||||
|
|
||||||
(s/def ::direction #{:up :down})
|
(s/def ::direction #{:up :down})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue