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

Unified Diff: cc/animation/scroll_offset_animation_curve.cc

Issue 1950613004: Fix bounds clamping during composited smooth scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unit test Created 4 years, 7 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 | « no previous file | cc/animation/scroll_offset_animations_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/scroll_offset_animation_curve.cc
diff --git a/cc/animation/scroll_offset_animation_curve.cc b/cc/animation/scroll_offset_animation_curve.cc
index 54f6fb70d8cb80941011638d0dcc0ff0ecd3909b..04614b572c89e40df4844e7c648beff0a0130d80 100644
--- a/cc/animation/scroll_offset_animation_curve.cc
+++ b/cc/animation/scroll_offset_animation_curve.cc
@@ -182,6 +182,11 @@ static double VelocityBasedDurationBound(gfx::Vector2dF old_delta,
void ScrollOffsetAnimationCurve::UpdateTarget(
double t,
const gfx::ScrollOffset& new_target) {
+ if (std::abs(MaximumDimension(target_value_.DeltaFrom(new_target))) <
+ kEpsilon) {
+ target_value_ = new_target;
+ return;
+ }
gfx::ScrollOffset current_position =
GetValue(base::TimeDelta::FromSecondsD(t));
gfx::Vector2dF old_delta = target_value_.DeltaFrom(initial_value_);
« no previous file with comments | « no previous file | cc/animation/scroll_offset_animations_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698