mirror of
https://github.com/penpot/penpot.git
synced 2026-07-22 22:17:58 +00:00
🐛 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:
parent
26c4ec18fe
commit
766368567e
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user