Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2974)

Unified Diff: chrome/views/text_field.cc

Issue 13008: Wrong caret position in Report Bug dialog when focused due... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698