Commit 7a68e4ec authored by Taylor Bergquist's avatar Taylor Bergquist Committed by Commit Bot

Fix NTB hit testing with RTL.

The NTB's insets are no longer horizontally symmetric, so they
need to be flipped when hit testing.

Bug: 1148176
Change-Id: I1d61592221e9b825927a8f16d93c7640642a9bd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547310Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Taylor Bergquist <tbergquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830737}
parent 4c33efab
...@@ -166,9 +166,11 @@ gfx::Size NewTabButton::CalculatePreferredSize() const { ...@@ -166,9 +166,11 @@ gfx::Size NewTabButton::CalculatePreferredSize() const {
bool NewTabButton::GetHitTestMask(SkPath* mask) const { bool NewTabButton::GetHitTestMask(SkPath* mask) const {
DCHECK(mask); DCHECK(mask);
gfx::Point origin = GetContentsBounds().origin();
if (base::i18n::IsRTL())
origin.set_x(GetInsets().right());
const float scale = GetWidget()->GetCompositor()->device_scale_factor(); const float scale = GetWidget()->GetCompositor()->device_scale_factor();
// TODO(pkasting): Fitts' Law horizontally when appropriate. SkPath border = GetBorderPath(origin, scale,
SkPath border = GetBorderPath(GetContentsBounds().origin(), scale,
tab_strip_->controller()->IsFrameCondensed()); tab_strip_->controller()->IsFrameCondensed());
mask->addPath(border, SkMatrix::Scale(1 / scale, 1 / scale)); mask->addPath(border, SkMatrix::Scale(1 / scale, 1 / scale));
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment