diff --git a/CHANGES.md b/CHANGES.md index e3d82334a..5b875992b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ - Fix firefox changing layer color type is not applied [Taiga #4292](https://tree.taiga.io/project/penpot/issue/4292) - Fix justify alignes text left [Taiga #4322](https://tree.taiga.io/project/penpot/issue/4322) - Fix text out of borders with "auto width" and center align [Taiga #4308](https://tree.taiga.io/project/penpot/issue/4308) +- Fix auto-width for texts can make text appear stretched [Github #2482](https://github.com/penpot/penpot/issues/2482) ## 1.16.0-beta diff --git a/common/src/app/common/geom/shapes/modifiers.cljc b/common/src/app/common/geom/shapes/modifiers.cljc index cd8a1ab02..d777d93be 100644 --- a/common/src/app/common/geom/shapes/modifiers.cljc +++ b/common/src/app/common/geom/shapes/modifiers.cljc @@ -21,7 +21,8 @@ "Adjust modifiers so they adjust to the pixel grid" [modifiers shape] - (if (some? (:resize-transform modifiers)) + (if (and (some? (:resize-transform modifiers)) + (not (gmt/unit? (:resize-transform modifiers)))) ;; If we're working with a rotation we don't handle pixel precision because ;; the transformation won't have the precision anyway modifiers @@ -243,7 +244,10 @@ (let [set-modifiers (fn [modif-tree id] - (assoc modif-tree id {:modifiers (get-modifier (get objects id))})) + (let [shape (get objects id) + modifiers (cond-> (get-modifier shape) snap-pixel? (set-pixel-precision shape))] + (-> modif-tree + (assoc id {:modifiers modifiers})))) modif-tree (reduce set-modifiers {} ids) diff --git a/frontend/resources/images/features/1.16-onboarding.gif b/frontend/resources/images/features/1.16-onboarding.gif index 43785fa72..ab59df05a 100644 Binary files a/frontend/resources/images/features/1.16-onboarding.gif and b/frontend/resources/images/features/1.16-onboarding.gif differ diff --git a/frontend/src/app/main/ui/shapes/text/svg_text.cljs b/frontend/src/app/main/ui/shapes/text/svg_text.cljs index f4b27f0b1..81a64374a 100644 --- a/frontend/src/app/main/ui/shapes/text/svg_text.cljs +++ b/frontend/src/app/main/ui/shapes/text/svg_text.cljs @@ -106,7 +106,8 @@ :textDecoration (:text-decoration data) :letterSpacing (:letter-spacing data) :fontStyle (:font-style data) - :direction (:direction data)} + :direction (:direction data) + :whiteSpace "pre"} (obj/set! "fill" (str "url(#fill-" index "-" render-id ")")))}) shape (assoc shape :fills (:fills data))]