From 68e0b3e7565620d5ca359ef11b940e06edf19c96 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 20 Apr 2022 14:16:51 +0200 Subject: [PATCH] :bug: Fix problem with text and blank spaces --- frontend/src/app/main/ui/shapes/text/styles.cljs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/shapes/text/styles.cljs b/frontend/src/app/main/ui/shapes/text/styles.cljs index bfa35f81f..57ded6ac2 100644 --- a/frontend/src/app/main/ui/shapes/text/styles.cljs +++ b/frontend/src/app/main/ui/shapes/text/styles.cljs @@ -21,7 +21,8 @@ base #js {:height height :width width :fontFamily "sourcesanspro" - :display "flex"}] + :display "flex" + :whiteSpace "pre-wrap"}] (cond-> base (= valign "top") (obj/set! "alignItems" "flex-start") (= valign "center") (obj/set! "alignItems" "center") @@ -45,18 +46,15 @@ :verticalAlign "top"})) (defn generate-paragraph-styles - [shape data] + [_shape data] (let [line-height (:line-height data 1.2) text-align (:text-align data "start") - grow-type (:grow-type shape) - base #js {:fontSize (str (:font-size data (:font-size txt/default-text-attrs)) "px") :lineHeight (:line-height data (:line-height txt/default-text-attrs)) :margin "inherit"}] (cond-> base (some? line-height) (obj/set! "lineHeight" line-height) - (some? text-align) (obj/set! "textAlign" text-align) - (= grow-type :auto-width) (obj/set! "whiteSpace" "pre")))) + (some? text-align) (obj/set! "textAlign" text-align)))) (defn generate-text-styles ([data]