mirror of
https://github.com/penpot/penpot.git
synced 2025-01-22 22:49:01 -05:00
🐛 Fix problem when copy/pasting shapes
This commit is contained in:
parent
26aec7d129
commit
f11c782c0f
2 changed files with 12 additions and 6 deletions
|
@ -54,6 +54,7 @@
|
||||||
- Fix problem with guides not showing when moving over nested frames [Taiga #4905](https://tree.taiga.io/project/penpot/issue/4905)
|
- Fix problem with guides not showing when moving over nested frames [Taiga #4905](https://tree.taiga.io/project/penpot/issue/4905)
|
||||||
- Fix change email and password for users signed in via social login [Taiga #4273](https://tree.taiga.io/project/penpot/issue/4273)
|
- Fix change email and password for users signed in via social login [Taiga #4273](https://tree.taiga.io/project/penpot/issue/4273)
|
||||||
- Fix drag and drop files from browser or file explorer under circumstances [Taiga #5054](https://tree.taiga.io/project/penpot/issue/5054)
|
- Fix drag and drop files from browser or file explorer under circumstances [Taiga #5054](https://tree.taiga.io/project/penpot/issue/5054)
|
||||||
|
- Fix problem when copy/pasting shapes [Taiga #4931](https://tree.taiga.io/project/penpot/issue/4931)
|
||||||
|
|
||||||
### :heart: Community contributions by (Thank you!)
|
### :heart: Community contributions by (Thank you!)
|
||||||
- To @ondrejkonec: for contributing to the code with:
|
- To @ondrejkonec: for contributing to the code with:
|
||||||
|
|
|
@ -1326,14 +1326,19 @@
|
||||||
res)))
|
res)))
|
||||||
|
|
||||||
(maybe-translate [shape objects selected+children]
|
(maybe-translate [shape objects selected+children]
|
||||||
(let [root-frame-id (cph/get-shape-id-root-frame objects (:id shape))]
|
(let [frame-id (:frame-id shape)
|
||||||
(if (and (not (cph/root-frame? shape))
|
root-frame-id (cph/get-shape-id-root-frame objects (:id shape))]
|
||||||
(not (contains? selected+children root-frame-id)))
|
(cond
|
||||||
;; When the parent frame is not selected we change to relative
|
(cph/root-frame? shape) shape
|
||||||
;; coordinates
|
(contains? selected+children root-frame-id) shape
|
||||||
|
|
||||||
|
(cph/frame-shape? shape)
|
||||||
(let [frame (get objects root-frame-id)]
|
(let [frame (get objects root-frame-id)]
|
||||||
(gsh/translate-to-frame shape frame))
|
(gsh/translate-to-frame shape frame))
|
||||||
shape)))
|
|
||||||
|
:else
|
||||||
|
(let [frame (get objects frame-id)]
|
||||||
|
(gsh/translate-to-frame shape frame)))))
|
||||||
|
|
||||||
(on-copy-error [error]
|
(on-copy-error [error]
|
||||||
(js/console.error "Clipboard blocked:" error)
|
(js/console.error "Clipboard blocked:" error)
|
||||||
|
|
Loading…
Add table
Reference in a new issue