Skip to content

Commit

Permalink
Fix incorrect TabCloseButton bounds in right-to-left layout.
Browse files Browse the repository at this point in the history
The elements Tab draws directly on the canvas need to be manually
mirrored if the View's layout is right-to-left.

BUG=315941
TEST=verify tab close button works correctly in both LTR and RTL layouts.
R=sky@chromium.org, tdanderson@chromium.org

Review URL: https://codereview.chromium.org/66543004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234048 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
hshi@chromium.org committed Nov 9, 2013
1 parent 35ecac1 commit 809aee3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chrome/browser/ui/views/tabs/tab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ class Tab::TabCloseButton : public views::ImageButton {
tab_->GetHitTestMask(source, &tab_mask);

gfx::Rect button_bounds(GetContentsBounds());
button_bounds.set_x(GetMirroredXForRect(button_bounds));
gfx::RectF tab_bounds_f(gfx::SkRectToRectF(tab_mask.getBounds()));
views::View::ConvertRectToTarget(tab_, this, &tab_bounds_f);
gfx::Rect tab_bounds = gfx::ToEnclosingRect(tab_bounds_f);
Expand Down

0 comments on commit 809aee3

Please sign in to comment.