Commit 82ede06e authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Update animating shelf background's drag handle bounds

Updates how animating shelf background's drag handle layer bounds are
calculated. Instead of directly using bounds from that the drag handle
view has within the opaque shelf widget, calculate the animating drag
handle bounds directly by centering the drag handle within the
animating background bounds.

Opaque background bounds are calculated based on the shelf widget size,
which may differ from the animating (in-app) shelf size (e.g. on home
screen). Using the opaque background drag handle bounds for animating
background would displace the drag handle when that is the case.

Change-Id: I51cb9a4d031286329784162193627bb09c608043
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079839Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745497}
parent a53cd0b2
......@@ -118,8 +118,10 @@ void HotseatTransitionAnimator::DoAnimation(HotseatState old_state,
shelf_widget_->GetAnimatingBackground()->SetColor(
ShelfConfig::Get()->GetMaximizedShelfColor());
shelf_widget_->GetAnimatingDragHandle()->SetBounds(
shelf_widget_->GetDragHandle()->bounds());
gfx::Rect drag_handle_bounds(shelf_widget_->GetAnimatingBackground()->size());
drag_handle_bounds.ClampToCenteredSize(ShelfConfig::Get()->DragHandleSize());
shelf_widget_->GetAnimatingDragHandle()->SetBounds(drag_handle_bounds);
animation_metrics_reporter_->set_new_state(new_state);
......
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