Commit dd661f30 authored by calamity's avatar calamity Committed by Commit bot

Fix folder icon animation in app list.

This CL fixes the animation of folders opening in the app list. This
regressed in r301308 because the ContentsView layer moved, exposing
a latent issue with the calculation of the top icon animation target.

The fix here is to use the view bounds as the target rather than the
layer bounds. The layer bounds are in the coordinate system of the
parent layer which is not what we want.

BUG=429079

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

Cr-Commit-Position: refs/heads/master@{#302579}
parent 3064611c
......@@ -49,12 +49,13 @@ void TopIconAnimationView::TransformView() {
set_owned_by_client();
// Transform used for scaling down the icon and move it back inside to the
// original folder icon.
const float kIconTransformScale = 0.33333f;
// original folder icon. The transform's origin is this view's origin.
gfx::Transform transform;
transform.Translate(scaled_rect_.x() - layer()->bounds().x(),
scaled_rect_.y() - layer()->bounds().y());
transform.Scale(kIconTransformScale, kIconTransformScale);
transform.Translate(scaled_rect_.x() - bounds().x(),
scaled_rect_.y() - bounds().y());
transform.Scale(
static_cast<double>(scaled_rect_.width()) / bounds().width(),
static_cast<double>(scaled_rect_.height()) / bounds().height());
if (open_folder_) {
// Transform to a scaled down icon inside the original folder icon.
......
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