@@ -37,20 +37,20 @@ int getLineCount() {
37
37
}
38
38
39
39
int getLineStartPosition (int charIdx ) {
40
- return textLayout ().getTextLine ( getLineOfCharacter (charIdx ) ). getStart ();
40
+ return textLayout ().getTextLine ( getLineOfCharacter (charIdx ), false ). start ();
41
41
}
42
42
43
43
int getLineEndPosition (int charIdx ) {
44
44
int line = getLineOfCharacter ( charIdx );
45
- int end = textLayout ().getTextLine ( line ). getEnd ();
45
+ int end = textLayout ().getTextLine ( line , false ). end ();
46
46
if ( line < (getLineCount () - 1 ) ) end --; // trailing space
47
47
return end ;
48
48
}
49
49
50
50
int getLineOfCharacter (int charIdx ) {
51
51
var layout = textLayout ();
52
52
return IntStream .range ( 0 , getLineCount () )
53
- .filter ( l -> charIdx < layout .getTextLine ( l ). getEnd () )
53
+ .filter ( l -> charIdx < layout .getTextLine ( l , false ). end () )
54
54
.findFirst ().orElse ( Math .max (0 ,getLineCount ()-1 ) );
55
55
}
56
56
@@ -154,22 +154,22 @@ PathElement[] getUnderlineShape(int from, int to, double offset, double waveRadi
154
154
}
155
155
156
156
CharacterHit hitLine (double x , int lineIndex ) {
157
- Rectangle2D r = textLayout ().getTextLine ( lineIndex ). getBounds ();
157
+ Rectangle2D r = textLayout ().getTextLine ( lineIndex , false ). bounds ();
158
158
double y = r .getMinY () + r .getHeight () / 2.0 ;
159
159
return hit ( x , y , lineIndex );
160
160
}
161
161
162
162
CharacterHit hit (double x , double y ) {
163
163
var layout = textLayout ();
164
164
int line = IntStream .range ( 0 , getLineCount () )
165
- .filter ( l -> y < layout .getTextLine ( l ). getBounds ().getMaxY () )
165
+ .filter ( l -> y < layout .getTextLine ( l , true ). bounds ().getMaxY () )
166
166
.findFirst ().orElse ( Math .max (0 ,getLineCount ()-1 ) );
167
167
return hit ( x , y , line );
168
168
}
169
169
170
170
CharacterHit hit (double x , double y , int line ) {
171
171
172
- Rectangle2D lineBounds = textLayout ().getTextLine ( line ). getBounds ();
172
+ Rectangle2D lineBounds = textLayout ().getTextLine ( line , false ). bounds ();
173
173
HitInfo hit = hitTest (new Point2D (x , y ));
174
174
int charIdx = hit .getCharIndex ();
175
175
boolean leading = hit .isLeading ();
@@ -181,7 +181,7 @@ CharacterHit hit(double x, double y, int line) {
181
181
if ( ! leading && getLineCount () > 1 ) {
182
182
// If this is a wrapped paragraph and hit character is at end of hit line, make sure that the
183
183
// "character hit" stays at the end of the hit line (and not at the beginning of the next line).
184
- leading = (getLineOfCharacter (charIdx ) + 1 < getLineCount () && charIdx + 1 >= textLayout ().getTextLine ( line ). getEnd ());
184
+ leading = (getLineOfCharacter (charIdx ) + 1 < getLineCount () && charIdx + 1 >= textLayout ().getTextLine ( line , false ). end ());
185
185
}
186
186
187
187
if (x < lineBounds .getMinX () || x > lineBounds .getMaxX ()) {
0 commit comments