diff --git a/CHANGES.md b/CHANGES.md index 0bb645fdd..e54f0d72e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ ### :sparkles: New features ### :bug: Bugs fixed +- Fix masked group resize strange behavior [Taiga #2317](https://tree.taiga.io/project/penpot/issue/2317). - Fix problems when exporting all artboards [Taiga #2234](https://tree.taiga.io/project/penpot/issue/2234). - Fix problems with team management [#1353](https://github.com/penpot/penpot/issues/1353) - Fix problem when importing in shared libraries [#1362](https://github.com/penpot/penpot/issues/1362) diff --git a/frontend/src/app/main/data/workspace/groups.cljs b/frontend/src/app/main/data/workspace/groups.cljs index b973e6c34..cdcf9d74e 100644 --- a/frontend/src/app/main/data/workspace/groups.cljs +++ b/frontend/src/app/main/data/workspace/groups.cljs @@ -244,7 +244,19 @@ [(first shapes) [] []] (prepare-create-group objects page-id shapes "Group-1" true)) + children (map #(get objects %) (:shapes group)) + rchanges (d/concat rchanges + (for [child children] + {:type :mod-obj + :page-id page-id + :id (:id child) + :operations [{:type :set + :attr :constraints-h + :val :scale} + {:type :set + :attr :constraints-v + :val :scale}]}) [{:type :mod-obj :page-id page-id :id (:id group) @@ -267,16 +279,26 @@ :page-id page-id :shapes [(:id group)]}]) - uchanges (conj uchanges - {:type :mod-obj - :page-id page-id - :id (:id group) - :operations [{:type :set - :attr :masked-group? - :val nil}]} - {:type :reg-objects - :page-id page-id - :shapes [(:id group)]})] + uchanges (d/concat uchanges + (for [child children] + {:type :mod-obj + :page-id page-id + :id (:id child) + :operations [{:type :set + :attr :constraints-h + :val (:constraints-h child)} + {:type :set + :attr :constraints-v + :val (:constraints-v child)}]}) + [{:type :mod-obj + :page-id page-id + :id (:id group) + :operations [{:type :set + :attr :masked-group? + :val nil}]} + {:type :reg-objects + :page-id page-id + :shapes [(:id group)]}])] (rx/of (dch/commit-changes {:redo-changes rchanges :undo-changes uchanges @@ -300,4 +322,3 @@ (rx/of (dch/commit-changes {:redo-changes rchanges-in-bulk :undo-changes uchanges-in-bulk :origin it})))))) - \ No newline at end of file