Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/x6/src/registry/attr/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down