diff --git a/CHANGES.md b/CHANGES.md index 8f82cff62..5617a320b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -70,6 +70,7 @@ - Fix problem when sliding color picker in selected-colors [#3150](https://github.com/penpot/penpot/issues/3150) - Fix error screen on upload image error [Taiga #5608](https://tree.taiga.io/project/penpot/issue/5608) - Fix bad frame-id for certain componentes [#3205](https://github.com/penpot/penpot/issues/3205) +- Fix paste elements at bottom of frame [Taig #5253](https://tree.taiga.io/project/penpot/issue/5253) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 704332767..0e49bf375 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1694,7 +1694,8 @@ [(:frame-id base) parent-id delta index]) ;; Paste inside selected frame otherwise - (let [origin-frame-id (:frame-id first-selected-obj) + (let [selected-frame-obj (get page-objects (first page-selected)) + origin-frame-id (:frame-id first-selected-obj) origin-frame-object (get page-objects origin-frame-id) margin-x (-> (- (:width origin-frame-object) (+ (:x wrapper) (:width wrapper))) @@ -1720,7 +1721,7 @@ ;; - Align it to the limits on the x and y axis ;; - Respect the distance of the object to the right and bottom in the original frame (gpt/point paste-x paste-y))] - [frame-id frame-id delta])) + [frame-id frame-id delta (dec (count (:shapes selected-frame-obj )))])) (empty? page-selected) (let [frame-id (ctst/top-nested-frame page-objects mouse-pos)