fix: 🐛 modify the font size even if the text does not change (#1397)

This commit is contained in:
vector
2021-10-02 19:07:42 +08:00
committed by GitHub
parent a256bbf9a2
commit 5731f761ba

View File

@ -39,13 +39,13 @@ export const text: Attr.Definition = {
const fontSize = (attrs['font-size'] || attrs.fontSize) as string
const textHash = JSON.stringify([text, options])
if (fontSize) {
elem.setAttribute('font-size', fontSize)
}
// Updates the text only if there was a change in the string
// or any of its attributes.
if (cache == null || cache !== textHash) {
if (fontSize) {
elem.setAttribute('font-size', fontSize)
}
// Text Along Path Selector
const textPath = options.textPath as any
if (textPath != null && typeof textPath === 'object') {