Commit bb18911e authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Center favicon scaling during animation in RTL

Fixes missing offset for non-zero bounds.x() for the icon area in
TabIcon::MaybePaintFavicon.

Bug: 1147408
Change-Id: I309c5074ee82c8a4ecc3cd14243c329088fb06a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2538207
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Dana Fried <dfried@chromium.org>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827493}
parent c4981af1
......@@ -336,8 +336,13 @@ void TabIcon::MaybePaintFavicon(gfx::Canvas* canvas,
2;
const float scale = std::min(diameter, SkFloatToScalar(gfx::kFaviconSize)) /
gfx::kFaviconSize;
// Translating to/from bounds offset is done to scale around the center
// point. This fixes RTL issues where bounds.x() is non-zero. See
// https://crbug.com/1147408
canvas->Translate(gfx::Vector2d(bounds.x(), bounds.y()));
canvas->Translate(gfx::Vector2d(offset, offset));
canvas->Scale(scale, scale);
canvas->Translate(gfx::Vector2d(-bounds.x(), -bounds.y()));
}
canvas->DrawImageInt(icon, 0, 0, bounds.width(), bounds.height(), bounds.x(),
......
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