Commit c3b0effb authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Fix NTB X coordinate for painting.

Things still look wrong even with this patch, because the Y coordinate is also
wrong; that's a deeper issue tracked in bug 866671.

Bug: 866665
Change-Id: I6a5f8fb159b3a70d71d1d17c904d2bd2d6d4fc6f
Reviewed-on: https://chromium-review.googlesource.com/1147085Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577558}
parent efbbccf7
......@@ -465,13 +465,13 @@ void NewTabButton::PaintFill(bool pressed,
// The new tab background is mirrored in RTL mode, but the theme
// background should never be mirrored. Mirror it here to compensate.
float x_scale = 1.0f;
int x = GetMirroredX() + background_offset_.x();
const gfx::Size size = GetContentsBounds().size();
const gfx::Rect& contents_bounds = GetContentsBounds();
int x = GetMirroredX() + contents_bounds.x() + background_offset_.x();
if (base::i18n::IsRTL()) {
x_scale = -1.0f;
// Offset by |width| such that the same region is painted as if there
// was no flip.
x += size.width();
x += contents_bounds.width();
}
const bool succeeded = canvas->InitPaintFlagsForTiling(
......
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