mirror of
https://github.com/penpot/penpot.git
synced 2025-02-18 21:06:11 -05:00
🐛 Fix snap to pixel on path creation and edit
This commit is contained in:
parent
c5d8d77070
commit
f93d0e1c4d
3 changed files with 3 additions and 5 deletions
|
@ -293,7 +293,7 @@
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(let [id (st/get-path-id state)]
|
(let [id (st/get-path-id state)]
|
||||||
(-> state
|
(-> state
|
||||||
(assoc-in [:workspace-local :edit-path id :snap-toggled] true))))
|
(assoc-in [:workspace-local :edit-path id :snap-toggled] false))))
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
|
|
|
@ -290,7 +290,7 @@
|
||||||
(or (not edit-path) (= :draw (:edit-mode edit-path)))
|
(or (not edit-path) (= :draw (:edit-mode edit-path)))
|
||||||
(assoc-in [:workspace-local :edit-path id] {:edit-mode :move
|
(assoc-in [:workspace-local :edit-path id] {:edit-mode :move
|
||||||
:selected #{}
|
:selected #{}
|
||||||
:snap-toggled true})
|
:snap-toggled false})
|
||||||
|
|
||||||
(and (some? edit-path) (= :move (:edit-mode edit-path)))
|
(and (some? edit-path) (= :move (:edit-mode edit-path)))
|
||||||
(assoc-in [:workspace-local :edit-path id :edit-mode] :draw))))
|
(assoc-in [:workspace-local :edit-path id :edit-mode] :draw))))
|
||||||
|
|
|
@ -106,9 +106,7 @@
|
||||||
on-toggle-snap
|
on-toggle-snap
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(fn [_]
|
(fn [_]
|
||||||
(st/emit! (drp/toggle-snap))))
|
(st/emit! (drp/toggle-snap))))]
|
||||||
|
|
||||||
]
|
|
||||||
[:div.path-actions
|
[:div.path-actions
|
||||||
[:div.viewport-actions-group
|
[:div.viewport-actions-group
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue