🐛 Fix problem with new frame inside layout

This commit is contained in:
alonso.torres 2023-02-15 13:37:07 +01:00
parent ece6193260
commit fd15ff940f
2 changed files with 6 additions and 7 deletions

View file

@ -5,11 +5,9 @@
- Fix invite members button text [Taiga #4794](https://tree.taiga.io/project/penpot/issue/4794) - 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) - 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 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) - 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 ## 1.17.2

View file

@ -77,7 +77,7 @@
([attrs] ([attrs]
(add-shape attrs {})) (add-shape attrs {}))
([attrs {:keys [no-select?]}] ([attrs {:keys [no-select? no-update-layout?]}]
(us/verify ::shape-attrs attrs) (us/verify ::shape-attrs attrs)
(ptk/reify ::add-shape (ptk/reify ::add-shape
ptk/WatchEvent ptk/WatchEvent
@ -108,7 +108,8 @@
(rx/concat (rx/concat
(rx/of (dwu/start-undo-transaction undo-id) (rx/of (dwu/start-undo-transaction undo-id)
(dch/commit-changes changes) (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? (when-not no-select?
(dws/select-shapes (d/ordered-set id))) (dws/select-shapes (d/ordered-set id)))
(dwu/commit-undo-transaction undo-id)) (dwu/commit-undo-transaction undo-id))
@ -387,8 +388,9 @@
undo-id (js/Symbol)] undo-id (js/Symbol)]
(rx/of (rx/of
(dwu/start-undo-transaction undo-id) (dwu/start-undo-transaction undo-id)
(add-shape shape) (add-shape shape {:no-update-layout? true})
(move-shapes-into-frame (:id shape) selected) (move-shapes-into-frame (:id shape) selected)
(ptk/data-event :layout/update [(:id shape)])
(dwu/commit-undo-transaction undo-id))))))))) (dwu/commit-undo-transaction undo-id)))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -453,4 +455,3 @@
(map (fn [[page-id frame-ids]] (map (fn [[page-id frame-ids]]
(dch/update-shapes frame-ids #(dissoc % :use-for-thumbnail?) {:page-id page-id}))))) (dch/update-shapes frame-ids #(dissoc % :use-for-thumbnail?) {:page-id page-id})))))
(rx/of (dch/update-shapes selected #(update % :use-for-thumbnail? not)))))))) (rx/of (dch/update-shapes selected #(update % :use-for-thumbnail? not))))))))