Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: ui/app_list/views/top_icon_animation_view.cc

Issue 694743002: Fix folder icon animation in app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher_page_api_do_actual_thing
Patch Set: add comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/top_icon_animation_view.cc
diff --git a/ui/app_list/views/top_icon_animation_view.cc b/ui/app_list/views/top_icon_animation_view.cc
index 1d6e2c50253ed6e8eba17695e1183b24cc1730bb..2f65f6113e1d1d3d174fe6786db4d40b4982bdfd 100644
--- a/ui/app_list/views/top_icon_animation_view.cc
+++ b/ui/app_list/views/top_icon_animation_view.cc
@@ -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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698