Skip to content

Commit 8dfc050

Browse files
author
Symeon94
committed
JavaFX25 introduced getCaretShape to replace caretShape, which clashes with the method in TextFlowExt
1 parent 8e9fed7 commit 8dfc050

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

richtextfx/src/main/java/org/fxmisc/richtext/ParagraphText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private void updateAllCaretShapes() {
328328
}
329329

330330
private void updateSingleCaret(CaretNode caretNode) {
331-
PathElement[] shape = getCaretShape(getClampedCaretPosition(caretNode), true);
331+
PathElement[] shape = getLeadingCaretShape(getClampedCaretPosition(caretNode));
332332
caretNode.getElements().setAll(shape);
333333
}
334334

richtextfx/src/main/java/org/fxmisc/richtext/TextFlowExt.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ int getLineOfCharacter(int charIdx) {
5252
return navigator.offsetToPosition(charIdx, Forward).getMajor();
5353
}
5454

55-
PathElement[] getCaretShape(int charIdx, boolean isLeading) {
56-
return caretShape(charIdx, isLeading);
55+
/**
56+
* The name of this method was changed from {@code getCaretShape} to {@code getLeadingCaretShape} because
57+
* of the introduction in {@link TextFlow} of a method with the same name in JavaFX 25+.
58+
* To make this method unique, the {@code isLeading} argument has been removed. If you need to use it, refer
59+
* to the {@link TextFlow} class with the original method.
60+
*/
61+
PathElement[] getLeadingCaretShape(int charIdx) {
62+
return caretShape(charIdx, true);
5763
}
5864

5965
PathElement[] getRangeShape(IndexRange range) {

0 commit comments

Comments
 (0)