diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 07:05:46 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 07:05:46 +0000 |
commit | f6aaa0f5dd47a98f87405070514f37cb924979d4 (patch) | |
tree | 0819e5e2f9a7de7b854e65ccd7145011f3961cce /views/touchui | |
parent | 8fe58e3699a5d7cfb9d4470005fa1c21fffbd79a (diff) | |
download | chromium_src-f6aaa0f5dd47a98f87405070514f37cb924979d4.zip chromium_src-f6aaa0f5dd47a98f87405070514f37cb924979d4.tar.gz chromium_src-f6aaa0f5dd47a98f87405070514f37cb924979d4.tar.bz2 |
Fix RenderText cached bounds and offset logic; update clients.
Ensure the display offset and cursor bounds are valid on use.
Build in offset logic to RenderText display and hit-testing.
Implement simpler temporary GetStringWidth and GetCursorBounds.
Fix SetDisplayRect signature, code file ordering, invalidation.
Rename and refactor a bit, update comments.
Fixes adornment display & hit testing on text field overflows.
Increases abstraction/encapsulation for easier client use.
BUG=90426
TEST=--use-pure-views / touch_ui textfield use with overflow.
Review URL: http://codereview.chromium.org/7466048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/touchui')
-rw-r--r-- | views/touchui/touch_selection_controller_impl_unittest.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/views/touchui/touch_selection_controller_impl_unittest.cc b/views/touchui/touch_selection_controller_impl_unittest.cc index a722af1..75353fe 100644 --- a/views/touchui/touch_selection_controller_impl_unittest.cc +++ b/views/touchui/touch_selection_controller_impl_unittest.cc @@ -38,7 +38,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase { textfield_ = new Textfield(); widget_ = new Widget; Widget::InitParams params(Widget::InitParams::TYPE_POPUP); - params.bounds = gfx::Rect(0, 0, 100, 100); + params.bounds = gfx::Rect(0, 0, 200, 200); widget_->Init(params); View* container = new View(); widget_->SetContentsView(container); @@ -58,12 +58,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase { gfx::RenderText* render_text = textfield_view_->GetRenderText(); gfx::Rect cursor_bounds = render_text->GetCursorBounds( gfx::SelectionModel(cursor_pos), false); - gfx::Rect display_rect = render_text->display_rect(); - int total_offset_x = display_rect.x() + render_text->display_offset().x(); - int total_offset_y = display_rect.y() + render_text->display_offset().y() + - (display_rect.height() - cursor_bounds.height()) / 2; - return gfx::Point(cursor_bounds.x() + total_offset_x, - cursor_bounds.bottom() + total_offset_y); + return gfx::Point(cursor_bounds.x(), cursor_bounds.bottom()); } TouchSelectionControllerImpl* GetSelectionController() { |