Merge pull request #6602 from penpot/elenatorro-11214-use-text-decoration-from-leaf

🐛 Fix reading text-decoration and text-transform from leaf, and fallback to paragraph values
This commit is contained in:
Alejandro Alonso 2025-05-30 13:33:58 +02:00 committed by GitHub
commit 90744c182e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 9 deletions

View file

@ -104,12 +104,17 @@
font-id (f/serialize-font-id (:font-id leaf))
font-family (hash (:font-family leaf))
font-variant-id (sr/serialize-uuid (:font-variant-id leaf))
leaf-text-decoration (or (sr/serialize-text-decoration (:text-decoration leaf)) (sr/serialize-text-decoration (:text-decoration paragraph)))
leaf-text-transform (or (sr/serialize-text-transform (:text-transform leaf)) (sr/serialize-text-transform (:text-transform paragraph)))
text-buffer (utf8->buffer (:text leaf))
text-length (.-byteLength text-buffer)
fills (:fills leaf)
total-fills (count fills)]
(.setUint8 dview offset font-style le?)
(.setUint8 dview (+ offset 1) leaf-text-decoration le?)
(.setUint8 dview (+ offset 2) leaf-text-transform le?)
(.setFloat32 dview (+ offset 4) font-size le?)
(.setUint32 dview (+ offset 8) font-weight le?)
(.setUint32 dview (+ offset 12) (aget font-id 0) le?)