mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 10:56:20 +00:00
Add update-path event.
This commit is contained in:
parent
8c7fc4aad6
commit
cd365b77d3
@ -387,6 +387,18 @@
|
|||||||
{:pre [(uuid? id) (uuid? shape)]}
|
{:pre [(uuid? id) (uuid? shape)]}
|
||||||
(DeleteInteracton. shape id))
|
(DeleteInteracton. shape id))
|
||||||
|
|
||||||
|
;; --- Path Modifications
|
||||||
|
|
||||||
|
(defrecord UpdatePath [id index delta]
|
||||||
|
rs/UpdateEvent
|
||||||
|
(-apply-update [_ state]
|
||||||
|
(update-in state [:shapes-by-id id :points index] gpt/add delta)))
|
||||||
|
|
||||||
|
(defn update-path
|
||||||
|
"Update a concrete point in the path shape."
|
||||||
|
[id index delta]
|
||||||
|
{:pre [(uuid? id) (number? index) (gpt/point? delta)]}
|
||||||
|
(UpdatePath. id index delta))
|
||||||
|
|
||||||
;; --- Events (implicit) (for selected)
|
;; --- Events (implicit) (for selected)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user