diff --git a/CHANGES.md b/CHANGES.md index b045535b2..8ccddfb21 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,11 +5,9 @@ - Fix invite members button text [Taiga #4794](https://tree.taiga.io/project/penpot/issue/4794) - Fix problem with opacity in frames [Taiga #4795](https://tree.taiga.io/project/penpot/issue/4795) -<<<<<<< HEAD - Fix correct behaviour for space-around and added space-evenly option -======= - Fix duplicate with alt and undo only undo one step [Taiga #4746](https://tree.taiga.io/project/penpot/issue/4746) ->>>>>>> d262fc2b7 (:bug: Fix duplicate with alt and undo only undo one step) +- Fix problem creating frames inside layout [Taiga #4844](https://tree.taiga.io/project/penpot/issue/4844) ## 1.17.2 diff --git a/frontend/src/app/main/data/workspace/shapes.cljs b/frontend/src/app/main/data/workspace/shapes.cljs index a87f4fbb5..356724254 100644 --- a/frontend/src/app/main/data/workspace/shapes.cljs +++ b/frontend/src/app/main/data/workspace/shapes.cljs @@ -77,7 +77,7 @@ ([attrs] (add-shape attrs {})) - ([attrs {:keys [no-select?]}] + ([attrs {:keys [no-select? no-update-layout?]}] (us/verify ::shape-attrs attrs) (ptk/reify ::add-shape ptk/WatchEvent @@ -108,7 +108,8 @@ (rx/concat (rx/of (dwu/start-undo-transaction undo-id) (dch/commit-changes changes) - (ptk/data-event :layout/update [(:parent-id shape)]) + (when-not no-update-layout? + (ptk/data-event :layout/update [(:parent-id shape)])) (when-not no-select? (dws/select-shapes (d/ordered-set id))) (dwu/commit-undo-transaction undo-id)) @@ -387,8 +388,9 @@ undo-id (js/Symbol)] (rx/of (dwu/start-undo-transaction undo-id) - (add-shape shape) + (add-shape shape {:no-update-layout? true}) (move-shapes-into-frame (:id shape) selected) + (ptk/data-event :layout/update [(:id shape)]) (dwu/commit-undo-transaction undo-id))))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -453,4 +455,3 @@ (map (fn [[page-id frame-ids]] (dch/update-shapes frame-ids #(dissoc % :use-for-thumbnail?) {:page-id page-id}))))) (rx/of (dch/update-shapes selected #(update % :use-for-thumbnail? not)))))))) -