diff --git a/common/src/app/common/geom/shapes/constraints.cljc b/common/src/app/common/geom/shapes/constraints.cljc index 3a2ab58b2..120d22290 100644 --- a/common/src/app/common/geom/shapes/constraints.cljc +++ b/common/src/app/common/geom/shapes/constraints.cljc @@ -326,7 +326,9 @@ reset-modifiers? (and (gpo/axis-aligned? parent-bounds) (gpo/axis-aligned? child-bounds) - (gpo/axis-aligned? transformed-parent-bounds)) + (gpo/axis-aligned? transformed-parent-bounds) + (not= :scale constraints-h) + (not= :scale constraints-v)) modifiers (if reset-modifiers? diff --git a/common/src/app/common/types/container.cljc b/common/src/app/common/types/container.cljc index 92f2969e0..2034ab58c 100644 --- a/common/src/app/common/types/container.cljc +++ b/common/src/app/common/types/container.cljc @@ -311,6 +311,19 @@ [new-root-shape (map remap-frame-id new-shapes) updated-shapes])) +(defn remove-swap-keep-attrs + "Remove flex children properties except the fit-content for flex layouts. These are properties + that we don't have to propagate to copies but will be respected when swapping components" + [shape] + (let [layout-item-h-sizing (when (and (ctl/flex-layout? shape) (ctl/auto-width? shape)) :auto) + layout-item-v-sizing (when (and (ctl/flex-layout? shape) (ctl/auto-height? shape)) :auto)] + (-> shape + (d/without-keys ctk/swap-keep-attrs) + (cond-> (some? layout-item-h-sizing) + (assoc :layout-item-h-sizing layout-item-h-sizing)) + (cond-> (some? layout-item-v-sizing) + (assoc :layout-item-v-sizing layout-item-v-sizing))))) + (defn make-component-instance "Generate a new instance of the component inside the given container. @@ -331,7 +344,7 @@ (-> (get-shape component-page (:main-instance-id component)) (assoc :parent-id nil) ;; On v2 we force parent-id to nil in order to behave like v1 (assoc :frame-id uuid/zero) - (d/without-keys ctk/swap-keep-attrs)) + (remove-swap-keep-attrs)) (get-shape component (:id component))) orig-pos (gpt/point (:x component-shape) (:y component-shape)) diff --git a/frontend/src/app/main/ui/comments.scss b/frontend/src/app/main/ui/comments.scss index 51e6ddadb..c41dcd306 100644 --- a/frontend/src/app/main/ui/comments.scss +++ b/frontend/src/app/main/ui/comments.scss @@ -108,6 +108,7 @@ word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; + white-space: pre-wrap; } .replies {