0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-18 10:41:29 -05:00

Merge pull request #1824 from penpot/alotor-fix-problem-with-texts

Fix problem with texts
This commit is contained in:
Andrey Antukh 2022-04-20 15:46:55 +02:00 committed by GitHub
commit 5eb53da374
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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]