0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-12 18:18:24 -05:00

🐛 Fix problem with editor line-height

This commit is contained in:
alonso.torres 2024-11-27 11:51:13 +01:00
parent 30a06249ff
commit 37b50497f3

View file

@ -73,11 +73,14 @@
;; it affects to the height calculation the browser does
font-size (if (some #(not= "" (:text %)) (:children paragraph))
"0"
(:font-size styles (:font-size txt/default-text-attrs)))]
(cond-> styles
;; Every paragraph must have line-height to be correctly rendered
(nil? (:line-height styles)) (assoc :line-height (:line-height txt/default-text-attrs))
true (assoc :font-size font-size))))
(:font-size styles (:font-size txt/default-text-attrs)))
line-height (:line-height styles)
line-height (if (and (some? line-height) (not= "" line-height))
line-height
(:line-height txt/default-text-attrs))]
(-> styles
(assoc :font-size font-size :line-height line-height))))
(defn get-root-styles
[root]