Commit 9a832d90 authored by David Black's avatar David Black Committed by Chromium LUCI CQ

Fix issue where small previews were visible before animating in.

Small previews were slightly visible before animating in because they
weren't sufficiently offset relative to the parent container.

Bug: 1166754
Change-Id: I4f7c06c460861591e058c537c542c00d8ac62495
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2629655Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#843813}
parent 04978e0f
......@@ -168,9 +168,15 @@ void HoldingSpaceTrayIconPreview::AnimateIn(base::TimeDelta additional_delay) {
if (!NeedsLayer())
return;
int pre_translate_y = -preview_size.height();
if (IsHorizontal(shelf_->alignment())) {
const gfx::Size& container_size = container_->size();
pre_translate_y = -container_size.height() +
(container_size.height() - preview_size.height()) / 2;
}
gfx::Transform pre_transform;
pre_transform.Translate(transform_.To2dTranslation().x(),
-preview_size.height());
pre_transform.Translate(transform_.To2dTranslation().x(), pre_translate_y);
CreateLayer(pre_transform);
......
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