0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

🐛 Fix problem with text and blank spaces

This commit is contained in:
alonso.torres 2022-04-20 14:16:51 +02:00
parent cc046555a3
commit 68e0b3e756

View file

@ -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]