0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-06 14:50:20 -05:00

Merge pull request #5384 from penpot/alotor-fix-editor

🐛 Fix problem with editor line-height
This commit is contained in:
Aitor Moreno 2024-11-27 12:01:58 +01:00 committed by GitHub
commit ede8ee6a78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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]