Skip to content

Commit e2b85ed

Browse files
Add API: get # of lines a wrapped paragraph spans
1 parent 9d5704f commit e2b85ed

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,13 @@ TwoDimensional.Position _position(int par, int line) {
799799
return navigator.position(par, line);
800800
}
801801

802+
/**
803+
* Gets the number of lines a paragraph spans when {@link #isWrapText()} is true, or otherwise returns 1.
804+
*/
805+
public int getParagraphLinesCount(int paragraphIndex) {
806+
return virtualFlow.getCell(paragraphIndex).getNode().getLineCount();
807+
}
808+
802809
@Override
803810
public final String getText(int start, int end) {
804811
return model.getText(start, end);

0 commit comments

Comments
 (0)