Skip to content

Commit 7a7df5b

Browse files
committed
Fix RichText#updateParagraphStyleInSelection.
StyledTextArea#setParagraphStyle is still broken, though.
1 parent e19fdd6 commit 7a7df5b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/richtext

richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/richtext/RichText.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,9 @@ private void updateStyleInSelection(StyleInfo mixin) {
265265
}
266266

267267
private void updateParagraphStyleInSelection(Function<StyleInfo, StyleInfo> updater) {
268-
Paragraph<StyleInfo, StyleInfo> paragraph = area.getParagraph(area.getCurrentParagraph());
269-
paragraph.setParagraphStyle(updater.apply(paragraph.getParagraphStyle()));
268+
int parIdx = area.getCurrentParagraph();
269+
Paragraph<StyleInfo, StyleInfo> paragraph = area.getParagraph(parIdx);
270+
area.setParagraphStyle(parIdx, updater.apply(paragraph.getParagraphStyle()));
270271
}
271272

272273
private void updateFontSize(Integer size) {

0 commit comments

Comments
 (0)