Chromium Code Reviews| Index: chrome/views/text_field.cc |
| =================================================================== |
| --- chrome/views/text_field.cc (revision 5817) |
| +++ chrome/views/text_field.cc (working copy) |
| @@ -819,12 +819,10 @@ |
| if (x < left_bound) |
| return left_bound; |
| - // See if we need to clip to the right edge of the text. |
| - const int length = GetTextLength(); |
| // Asking for the coordinate of any character past the end of the text gets |
| // the pixel just to the right of the last character. |
| - const int right_bound = std::min(r.right, PosFromChar(length).x); |
| - if ((length == 0) || (x < right_bound)) |
| + const int right_bound = std::min(r.right, PosFromChar(x).x); |
|
Peter Kasting
2008/12/01 00:28:28
The old code is definitely wrong for multiline tex
|
| + if ((x == 0) || (x < right_bound)) |
| return x; |
| // For trailing characters that are 2 pixels wide of less (like "l" in some |