Commit 5de47830 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix folder animation in RTL

Bug: 462296
Change-Id: I14fade7b9324f869192c4131d2d41d282278d85a
Reviewed-on: https://chromium-review.googlesource.com/c/1352536Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611812}
parent 44a6d650
......@@ -577,7 +577,8 @@ void AppListFolderView::UpdatePreferredBounds() {
// Calculate the folder icon's bounds relative to AppsContainerView.
gfx::RectF rect(activated_folder_item_view->GetIconBounds());
ConvertRectToTarget(activated_folder_item_view, container_view_, &rect);
gfx::Rect icon_bounds_in_container = gfx::ToEnclosingRect(rect);
gfx::Rect icon_bounds_in_container =
container_view_->GetMirroredRect(gfx::ToEnclosingRect(rect));
// The opened folder view's center should try to overlap with the folder
// item's center while it must fit within the bounds of AppsContainerView and
......
......@@ -3027,7 +3027,7 @@ void AppsGridView::StartFolderDroppingAnimation(
const gfx::Rect& source_bounds) {
// Calculate target bounds of dragged item.
gfx::Rect target_bounds =
GetTargetIconRectInFolder(drag_item, folder_item_view);
GetMirroredRect(GetTargetIconRectInFolder(drag_item, folder_item_view));
// Update folder icon.
AppListFolderItem* folder_item =
......
......@@ -73,7 +73,7 @@ void TopIconAnimationView::TransformView() {
// Transform used for scaling down the icon and move it back inside to the
// original folder icon. The transform's origin is this view's origin.
gfx::Transform transform;
transform.Translate(scaled_rect_.x() - bounds().x(),
transform.Translate(scaled_rect_.x() - GetMirroredX(),
scaled_rect_.y() - bounds().y());
transform.Scale(
static_cast<double>(scaled_rect_.width()) / bounds().width(),
......
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