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

Unified Diff: ui/views/animation/bounds_animator.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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/gfx/screen_mac.mm ('k') | ui/views/animation/bounds_animator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/bounds_animator.cc
diff --git a/ui/views/animation/bounds_animator.cc b/ui/views/animation/bounds_animator.cc
index 2c3fd053543b8d2f1461b0fe0f8471691e2bdfdb..037b9d6b5b64ea1509fabe62ae322735bfe073f6 100644
--- a/ui/views/animation/bounds_animator.cc
+++ b/ui/views/animation/bounds_animator.cc
@@ -235,14 +235,12 @@ void BoundsAnimator::AnimationProgressed(const Animation* animation) {
gfx::Rect new_bounds =
animation->CurrentValueBetween(data.start_bounds, data.target_bounds);
if (new_bounds != view->bounds()) {
- gfx::Rect total_bounds = new_bounds.Union(view->bounds());
+ gfx::Rect total_bounds = view->bounds();
+ total_bounds.Union(new_bounds);
// Build up the region to repaint in repaint_bounds_. We'll do the repaint
// when all animations complete (in AnimationContainerProgressed).
- if (repaint_bounds_.IsEmpty())
- repaint_bounds_ = total_bounds;
- else
- repaint_bounds_ = repaint_bounds_.Union(total_bounds);
+ repaint_bounds_.Union(total_bounds);
view->SetBoundsRect(new_bounds);
}
« no previous file with comments | « ui/gfx/screen_mac.mm ('k') | ui/views/animation/bounds_animator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698