0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 01:01:30 -05:00

🐛 Fix problem when ctrl+d when moving

This commit is contained in:
alonso.torres 2021-10-08 13:37:06 +02:00
parent 350c44f56f
commit 4bf5434e8f
2 changed files with 32 additions and 25 deletions

View file

@ -73,9 +73,15 @@
(fn [subpaths current] (fn [subpaths current]
(let [is-move? (= :move-to (:command current)) (let [is-move? (= :move-to (:command current))
last-idx (dec (count subpaths))] last-idx (dec (count subpaths))]
(if is-move? (cond
is-move?
(conj subpaths (make-subpath current)) (conj subpaths (make-subpath current))
(update subpaths last-idx add-subpath-command current))))]
(>= last-idx 0)
(update subpaths last-idx add-subpath-command current)
:else
subpaths)))]
(->> content (->> content
(reduce reduce-subpath [])))) (reduce reduce-subpath []))))

View file

@ -432,6 +432,7 @@
(ptk/reify ::duplicate-selected (ptk/reify ::duplicate-selected
ptk/WatchEvent ptk/WatchEvent
(watch [it state _] (watch [it state _]
(when (nil? (get-in state [:workspace-local :transform]))
(let [page-id (:current-page-id state) (let [page-id (:current-page-id state)
objects (wsh/lookup-page-objects state page-id) objects (wsh/lookup-page-objects state page-id)
selected (wsh/lookup-selected state) selected (wsh/lookup-selected state)
@ -461,7 +462,7 @@
:undo-changes uchanges :undo-changes uchanges
:origin it}) :origin it})
(select-shapes selected) (select-shapes selected)
(memorize-duplicated id-original id-duplicated)))))) (memorize-duplicated id-original id-duplicated)))))))
(defn change-hover-state (defn change-hover-state
[id value] [id value]