TextFlow.caretShape() produces incorrect caret paths in the presence of inline Nodes, as can be seen using the Monkey Tester TextFlow Page (see attached screenshots).
The code that visualizes caret shape iterates over the length of text, appending PathElements obtained from caretShape() for each position in the text:
TextFlow control = ...
for(int i=0; i<len; i++) {
PathElement[] es = control.caretShape(i, true);
caretPath.getElements().addAll(es);
}
To reproduce, select Text: "Inline Nodes" and check 'show caret path'.
Monkey Tester:
https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/monkey/MonkeyTesterApp.java
The code that visualizes caret shape iterates over the length of text, appending PathElements obtained from caretShape() for each position in the text:
TextFlow control = ...
for(int i=0; i<len; i++) {
PathElement[] es = control.caretShape(i, true);
caretPath.getElements().addAll(es);
}
To reproduce, select Text: "Inline Nodes" and check 'show caret path'.
Monkey Tester:
https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/monkey/MonkeyTesterApp.java
- blocks
-
JDK-8300569 ☂ Missing APIs related to rich text control
- In Progress
-
JDK-8301121 RichTextArea Control (Incubator)
- In Progress
- relates to
-
JDK-8199094 TextFlow caretShape method returns wrong coordinates when TextFlow has left inset.
- Open