mirror of
https://github.com/penpot/penpot.git
synced 2026-06-01 21:20:18 +00:00
🐛 Avoid restoring empty saved-font-size to prevent invalid text shapes on save (#9917)
This commit is contained in:
parent
921c5a4294
commit
6663105f4b
@ -66,7 +66,9 @@
|
||||
(d/merge txt/default-paragraph-attrs txt/default-text-attrs))
|
||||
;; Recover real font-size from data attribute, which to_dom/get-paragraph-styles may have
|
||||
;; changed to "0" ("0" trick to avoid it interfering with height calculation in the browser).
|
||||
saved-font-size (dom/get-data element "saved-font-size")]
|
||||
saved-font-size (dom/get-data element "saved-font-size")
|
||||
saved-font-size (when (and (string? saved-font-size) (not (empty? saved-font-size)))
|
||||
saved-font-size)]
|
||||
(cond-> styles
|
||||
(some? saved-font-size)
|
||||
(assoc :font-size saved-font-size))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user