mirror of
https://github.com/penpot/penpot.git
synced 2026-08-05 12:29:00 +00:00
Merge pull request #1824 from penpot/alotor-fix-problem-with-texts
Fix problem with texts
This commit is contained in:
commit
5eb53da374
@ -21,7 +21,8 @@
|
|||||||
base #js {:height height
|
base #js {:height height
|
||||||
:width width
|
:width width
|
||||||
:fontFamily "sourcesanspro"
|
:fontFamily "sourcesanspro"
|
||||||
:display "flex"}]
|
:display "flex"
|
||||||
|
:whiteSpace "pre-wrap"}]
|
||||||
(cond-> base
|
(cond-> base
|
||||||
(= valign "top") (obj/set! "alignItems" "flex-start")
|
(= valign "top") (obj/set! "alignItems" "flex-start")
|
||||||
(= valign "center") (obj/set! "alignItems" "center")
|
(= valign "center") (obj/set! "alignItems" "center")
|
||||||
@ -45,18 +46,15 @@
|
|||||||
:verticalAlign "top"}))
|
:verticalAlign "top"}))
|
||||||
|
|
||||||
(defn generate-paragraph-styles
|
(defn generate-paragraph-styles
|
||||||
[shape data]
|
[_shape data]
|
||||||
(let [line-height (:line-height data 1.2)
|
(let [line-height (:line-height data 1.2)
|
||||||
text-align (:text-align data "start")
|
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")
|
base #js {:fontSize (str (:font-size data (:font-size txt/default-text-attrs)) "px")
|
||||||
:lineHeight (:line-height data (:line-height txt/default-text-attrs))
|
:lineHeight (:line-height data (:line-height txt/default-text-attrs))
|
||||||
:margin "inherit"}]
|
:margin "inherit"}]
|
||||||
(cond-> base
|
(cond-> base
|
||||||
(some? line-height) (obj/set! "lineHeight" line-height)
|
(some? line-height) (obj/set! "lineHeight" line-height)
|
||||||
(some? text-align) (obj/set! "textAlign" text-align)
|
(some? text-align) (obj/set! "textAlign" text-align))))
|
||||||
(= grow-type :auto-width) (obj/set! "whiteSpace" "pre"))))
|
|
||||||
|
|
||||||
(defn generate-text-styles
|
(defn generate-text-styles
|
||||||
([data]
|
([data]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user