0
Fork 0
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:
Eva 2023-01-18 11:57:48 +01:00 committed by Alonso Torres
parent c5d8d77070
commit f93d0e1c4d
3 changed files with 3 additions and 5 deletions

View file

@ -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]

View file

@ -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))))

View file

@ -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