diff --git a/CHANGES.md b/CHANGES.md index d627b81fb..104bdc889 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -46,6 +46,7 @@ - Fix horizontal margins drag don't always start from place [Taiga #5020](https://tree.taiga.io/project/penpot/issue/5020) - Fix multiplayer username sometimes is not displayed correctly [Taiga #4400](https://tree.taiga.io/project/penpot/issue/4400) - Show warning when trying to invite a user that is already in members [Taiga #4147](https://tree.taiga.io/project/penpot/issue/4147) +- Fix problem with text out of borders when changing from auto-width to fixed [Taiga #4308](https://tree.taiga.io/project/penpot/issue/4308) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs b/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs index a6433818b..14ef7aace 100644 --- a/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/text/viewport_texts_html.cljs @@ -234,10 +234,11 @@ ;; When we have a text with grow-type :auto-height or :auto-height we need to check the correct height ;; otherwise the center alignment will break - tr-shape (when text-modifier (dwt/apply-text-modifier shape text-modifier)) - shape (cond-> shape - (and (some? text-modifier) (#{:auto-height :auto-width} (:grow-type shape))) - (assoc :width (:width tr-shape) :height (:height tr-shape))) + shape + (if (some? text-modifier) + (let [{:keys [width height]} (dwt/apply-text-modifier shape text-modifier)] + (assoc shape :width width :height height)) + shape) shape (hooks/use-equal-memo shape)