diff options
author | xji@google.com <xji@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-07 20:20:23 +0000 |
---|---|---|
committer | xji@google.com <xji@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-07 20:20:23 +0000 |
commit | 65788136d0484f496bd388789c8b8a651b5013a7 (patch) | |
tree | 896615fb1ceec32212ea9f91a8b1ef5c04aacece /ui | |
parent | 2897bccb0244e4c279fc638ecac59a600394dcb9 (diff) | |
download | chromium_src-65788136d0484f496bd388789c8b8a651b5013a7.zip chromium_src-65788136d0484f496bd388789c8b8a651b5013a7.tar.gz chromium_src-65788136d0484f496bd388789c8b8a651b5013a7.tar.bz2 |
Since cursor width is 0, need to offset cursor_bounds_.x and display_offst_.x by 1 pixel when text overflow to right in order for cursor to be drawn.
BUG=90426
TEST=--use-pure-views, type in ASCII characters in omnibox till text overflow, cursor should be correctly drawn at the right edge.
Review URL: http://codereview.chromium.org/7840039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99998 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/render_text.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index 5946875..1111842 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc @@ -656,13 +656,13 @@ void RenderText::UpdateCachedBoundsAndOffset() { if (string_width < display_width) { // Show all text whenever the text fits to the size. delta_offset = -display_offset_.x(); - } else if (cursor_bounds_.right() > display_rect_.right()) { + } else if (cursor_bounds_.right() >= display_rect_.right()) { // TODO(xji): when the character overflow is a RTL character, currently, if // we pan cursor at the rightmost position, the entered RTL character is not // displayed. Should pan cursor to show the last logical characters. // // Pan to show the cursor when it overflows to the right, - delta_offset = display_rect_.right() - cursor_bounds_.right(); + delta_offset = display_rect_.right() - cursor_bounds_.right() - 1; } else if (cursor_bounds_.x() < display_rect_.x()) { // TODO(xji): have similar problem as above when overflow character is a // LTR character. |