🐛 Ensure text position-data always includes :fills key (#10650)

Position-data entries for text shapes could omit the :fills key when the
element had no explicit fills, causing backend malli validation failures.

- Use get-default-text-attrs as base in WASM calculate-position-data
- Default fills when CSS --fills property is absent in DOM calc path

AI-assisted-by: deepseek-v4-pro
This commit is contained in:
Andrey Antukh 2026-07-20 14:45:36 +02:00 committed by GitHub
parent 26c4ec18fe
commit 766368567e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -2557,7 +2557,7 @@
(when (and element element-text)
(let [text (subs element-text start-pos end-pos)]
(d/patch-object
txt/default-text-attrs
(txt/get-default-text-attrs)
(d/without-nils
{:x x
:y (+ y height)

View File

@ -9,6 +9,7 @@
[app.common.data :as d]
[app.common.data.macros :as dm]
[app.common.transit :as transit]
[app.common.types.text :as txt]
[app.main.fonts :as fonts]
[app.util.dom :as dom]
[app.util.text-position-data :as tpd]
@ -105,7 +106,8 @@
:text-decoration (dm/str (get-prop styles "text-decoration"))
:letter-spacing (dm/str (get-prop styles "letter-spacing"))
:font-style (dm/str (get-prop styles "font-style"))
:fills (transit/decode-str (get-prop styles "--fills"))
:fills (or (transit/decode-str (get-prop styles "--fills"))
txt/default-text-fills)
:text text})))]
(when (some? shape-id)