Skip to content

Commit

Permalink
[DownloadBubble] Always invalidate layout when showing animation
Browse files Browse the repository at this point in the history
This fixes a bug that caused the download animation to go up the left
side of the window to (0, 0). By always invalidating the layout when the
animation needs to be displayed, we will force Layout() to run first
before the code that calculates the animation's position based on the
view bounds.

Bug: 1428369
Change-Id: Idb381181e3790b3b76f550c51368570b77e00d01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4375591
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1123095}
  • Loading branch information
chlily1 authored and Chromium LUCI CQ committed Mar 28, 2023
1 parent 1e42a8e commit 771f528
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,8 @@ void DownloadToolbarButtonView::Disable() {
void DownloadToolbarButtonView::UpdateDownloadIcon(bool show_animation) {
if (show_animation && gfx::Animation::ShouldRenderRichAnimation()) {
has_pending_download_started_animation_ = true;
if (!needs_layout()) {
ShowPendingDownloadStartedAnimation();
}
// Invalidate the layout to show the animation in Layout().
PreferredSizeChanged();
}
UpdateIcon();
}
Expand Down

0 comments on commit 771f528

Please sign in to comment.