Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: ui/compositor/layer.cc

Issue 241983003: Stops animations when removing a window from its parent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stops animations when removing a layer from its parent and fixes broken test Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index df67e9075c5cbc775179c05ffe5ddec68b53f2f0..a0a3bca93c8d5a7629a4b910bfaa3d2d0db48004 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -164,6 +164,12 @@ void Layer::Add(Layer* child) {
}
void Layer::Remove(Layer* child) {
+ // Current bounds are used to calculate offsets when layers are reparented.
+ // Stop (and complete) an ongoing animation to update the bounds immediately.
+ if (child->GetAnimator()) {
+ child->GetAnimator()->StopAnimatingProperty(
+ ui::LayerAnimationElement::BOUNDS);
+ }
std::vector<Layer*>::iterator i =
std::find(children_.begin(), children_.end(), child);
DCHECK(i != children_.end());
« no previous file with comments | « ui/aura/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698