🐛 Fix letter spacing applied to paragraph

This commit is contained in:
Aitor Moreno
2025-11-28 10:41:45 +01:00
parent 95c0d42d5b
commit 405ddb60d8
2 changed files with 7 additions and 2 deletions

View File

@@ -80,7 +80,7 @@
font-size (f/serialize-font-size font-size) font-size (f/serialize-font-size font-size)
line-height (f/serialize-line-height (get span :line-height) paragraph-line-height) line-height (f/serialize-line-height (get span :line-height) paragraph-line-height)
letter-spacing (f/serialize-letter-spacing (get paragraph :letter-spacing)) letter-spacing (f/serialize-letter-spacing (get span :letter-spacing))
font-weight (get span :font-weight paragraph-font-weight) font-weight (get span :font-weight paragraph-font-weight)
font-weight (f/serialize-font-weight font-weight) font-weight (f/serialize-font-weight font-weight)

View File

@@ -1967,9 +1967,14 @@ export class SelectionController extends EventTarget {
this.setSelection(newTextSpan.firstChild, 0, newTextSpan.firstChild, 0); this.setSelection(newTextSpan.firstChild, 0, newTextSpan.firstChild, 0);
} }
// The styles are applied to the paragraph // The styles are applied to the paragraph
else { else
{
const paragraph = this.startParagraph; const paragraph = this.startParagraph;
setParagraphStyles(paragraph, newStyles); setParagraphStyles(paragraph, newStyles);
// Apply styles to child text spans.
for (const textSpan of paragraph.children) {
setTextSpanStyles(textSpan, newStyles);
}
} }
return this.#notifyStyleChange(); return this.#notifyStyleChange();