Commit 000fab70 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Fix jump when hotseat animates to hidden.

The shelf size can change, now that target bounds are stored in
ShelfLayoutManager, use this to ensure the hotseat does not jump.

Bug: 1022155
Change-Id: I19fbf1f0193f433bceeb21963d3967c01340e9ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935128Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718964}
parent bfd5c882
...@@ -1047,11 +1047,9 @@ int ShelfLayoutManager::CalculateHotseatYInShelf( ...@@ -1047,11 +1047,9 @@ int ShelfLayoutManager::CalculateHotseatYInShelf(
ShelfConfig::Get()->hotseat_bottom_padding() + hotseat_size; ShelfConfig::Get()->hotseat_bottom_padding() + hotseat_size;
break; break;
} }
const int target_shelf_size = hotseat_target_state == HotseatState::kShown const int current_shelf_size = target_bounds_.shelf_bounds.size().height();
? ShelfConfig::Get()->system_shelf_size()
: ShelfConfig::Get()->in_app_shelf_size();
const int hotseat_y_in_shelf = const int hotseat_y_in_shelf =
-(hotseat_distance_from_bottom_of_display - target_shelf_size); -(hotseat_distance_from_bottom_of_display - current_shelf_size);
return hotseat_y_in_shelf; return hotseat_y_in_shelf;
} }
......
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