mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 00:58:26 -05:00
Add toggle shape locking event.
This commit is contained in:
parent
c3105fd698
commit
4b6ad74f6b
1 changed files with 11 additions and 0 deletions
|
@ -282,6 +282,17 @@
|
|||
(assoc-in state [:shapes-by-id sid] (assoc shape :blocked false))
|
||||
(assoc-in state [:shapes-by-id sid] (assoc shape :blocked true)))))))
|
||||
|
||||
(defn toggle-shape-locking
|
||||
[sid]
|
||||
(reify
|
||||
rs/UpdateEvent
|
||||
(-apply-update [_ state]
|
||||
(let [shape (get-in state [:shapes-by-id sid])
|
||||
locked? (:locked shape false)]
|
||||
(if locked?
|
||||
(assoc-in state [:shapes-by-id sid] (assoc shape :locked false))
|
||||
(assoc-in state [:shapes-by-id sid] (assoc shape :locked true)))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Events (for selected)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Reference in a new issue