Merge pull request #6445 from penpot/elenatorro-11044-fix-parsing-text-spaces

🐛 Fix parsing text spaces
This commit is contained in:
Elena Torró 2025-05-09 12:31:17 +02:00 committed by GitHub
commit 15e9d92094
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 10 deletions

View file

@ -1194,6 +1194,4 @@
origin
(:transform shape (gmt/matrix))
(:transform-inverse shape (gmt/matrix)))}}]
(.log js/console (clj->js modifiers))
(rx/of (dwm/set-wasm-modifiers modifiers))))))

View file

@ -10,8 +10,7 @@
[app.render-wasm.helpers :as h]
[app.render-wasm.mem :as mem]
[app.render-wasm.serializers :as sr]
[app.render-wasm.wasm :as wasm]
[clojure.string :as str]))
[app.render-wasm.wasm :as wasm]))
(defn utf8->buffer [text]
(let [encoder (js/TextEncoder.)]
@ -21,8 +20,7 @@
;; buffer has the following format:
;; [<num-leaves> <paragraph_attributes> <leaves_attributes> <text>]
[leaves paragraph text]
(let [leaves (filter #(not (str/blank? (:text %))) leaves)
num-leaves (count leaves)
(let [num-leaves (count leaves)
paragraph-attr-size 48
leaf-attr-size 52
metadata-size (+ 1 paragraph-attr-size (* num-leaves leaf-attr-size))