* Returns the rendered text's width. * @param line Line to get the width, or -1 to get whole text width. * @return Width in pixels. */
| 321 | * @return Width in pixels. |
| 322 | */ |
| 323 | int Text::getTextWidth(int line) const |
| 324 | { |
| 325 | if (line == -1) |
| 326 | { |
| 327 | int width = 0; |
| 328 | for (std::vector<int>::const_iterator i = _lineWidth.begin(); i != _lineWidth.end(); ++i) |
| 329 | { |
| 330 | if (*i > width) |
| 331 | { |
| 332 | width = *i; |
| 333 | } |
| 334 | } |
| 335 | return width; |
| 336 | } |
| 337 | else |
| 338 | { |
| 339 | return _lineWidth[line]; |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | /** |
| 344 | * Takes care of any text post-processing like calculating |
no outgoing calls
no test coverage detected