@@ -1680,8 +1680,6 @@ class LineMetrics {
16801680 this .left,
16811681 this .baseline,
16821682 this .lineNumber,
1683- this .startIndex,
1684- this .endIndex,
16851683 });
16861684
16871685 @pragma ('vm:entry-point' )
@@ -1695,8 +1693,6 @@ class LineMetrics {
16951693 this .left,
16961694 this .baseline,
16971695 this .lineNumber,
1698- this .startIndex,
1699- this .endIndex,
17001696 );
17011697
17021698 /// True if this line ends with an explicit line break (e.g. '\n') or is the end
@@ -1764,13 +1760,6 @@ class LineMetrics {
17641760 ///
17651761 /// For example, the first line is line 0, second line is line 1.
17661762 final int lineNumber;
1767-
1768- /// The starting text index for this line, in Unicode code points.
1769- final int startIndex;
1770-
1771- /// The ending text index, including the newline for this line, in Unicode
1772- /// code points.
1773- final int endIndex;
17741763}
17751764
17761765/// A paragraph of text.
@@ -1882,16 +1871,8 @@ class Paragraph extends NativeFieldWrapperClass2 {
18821871 /// on both sides. In such cases, this method will return [offset, offset+1] .
18831872 /// Word boundaries are defined more precisely in Unicode Standard Annex #29
18841873 /// http://www.unicode.org/reports/tr29/#Word_Boundaries
1885- TextRange getWordBoundary (dynamic position) {
1886- // TODO(gspencergoog): have this take only a TextPosition once the framework
1887- // code is calling it with that.
1888- List <int > boundary;
1889- if (position is TextPosition ) {
1890- boundary = _getWordBoundary (position.offset);
1891- } else {
1892- final int offset = position;
1893- boundary = _getWordBoundary (offset);
1894- }
1874+ TextRange getWordBoundary (TextPosition position) {
1875+ final List <int > boundary = _getWordBoundary (position.offset);
18951876 return TextRange (start: boundary[0 ], end: boundary[1 ]);
18961877 }
18971878 List <int > _getWordBoundary (int offset) native 'Paragraph_getWordBoundary' ;
@@ -1901,10 +1882,12 @@ class Paragraph extends NativeFieldWrapperClass2 {
19011882 /// The newline (if any) is returned as part of the range.
19021883 ///
19031884 /// This can potentially be expensive, since it needs to compute the line
1904- /// metrics, so use it sparingly. If higher performance is needed, caching the
1905- /// results of [computeLineMetrics] is recommended (which also contains the
1906- /// start and end of each line).
1907- List <int > getLineBoundary (int offset) native 'Paragraph_getLineBoundary' ;
1885+ /// metrics, so use it sparingly.
1886+ TextRange getLineBoundary (TextPosition position) {
1887+ final List <int > boundary = _getLineBoundary (position.offset);
1888+ return TextRange (start: boundary[0 ], end: boundary[1 ]);
1889+ }
1890+ List <int > _getLineBoundary (int offset) native 'Paragraph_getLineBoundary' ;
19081891
19091892 // Redirecting the paint function in this way solves some dependency problems
19101893 // in the C++ code. If we straighten out the C++ dependencies, we can remove
0 commit comments