OLD | NEW |
1 part of view; | |
2 | |
3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
5 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
6 | 4 |
7 // TODO(jacobr): handle splitting lines on symbols such as '-' that aren't | 5 // TODO(jacobr): handle splitting lines on symbols such as '-' that aren't |
8 // whitespace but are valid word breaking points. | 6 // whitespace but are valid word breaking points. |
9 /** | 7 /** |
10 * Utility class to efficiently word break and measure text without requiring | 8 * Utility class to efficiently word break and measure text without requiring |
11 * access to the DOM. | 9 * access to the DOM. |
12 */ | 10 */ |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } else if (wordStartIndex === null && !whitespace) { | 152 } else if (wordStartIndex === null && !whitespace) { |
155 wordStartIndex = i; | 153 wordStartIndex = i; |
156 } | 154 } |
157 lastWhitespace = whitespace; | 155 lastWhitespace = whitespace; |
158 } | 156 } |
159 if (currentLength > 0) { | 157 if (currentLength > 0) { |
160 callback(startIndex, text.length, currentLength); | 158 callback(startIndex, text.length, currentLength); |
161 } | 159 } |
162 } | 160 } |
163 } | 161 } |
OLD | NEW |