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

Side by Side Diff: ui/events/gestures/blink/web_gesture_curve_impl.cc

Issue 2767213003: First Implementation of Snapped Points
Patch Set: Rebase and format Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/events/gestures/blink/web_gesture_curve_impl.h ('k') | ui/events/gestures/fling_curve.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" 5 #include "ui/events/gestures/blink/web_gesture_curve_impl.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 if (delta.IsZero()) 146 if (delta.IsZero())
147 return still_active; 147 return still_active;
148 148
149 // scrollBy() could delete this curve if the animation is over, so don't touch 149 // scrollBy() could delete this curve if the animation is over, so don't touch
150 // any member variables after making that call. 150 // any member variables after making that call.
151 bool did_scroll = target->ScrollBy(blink::WebFloatSize(delta), 151 bool did_scroll = target->ScrollBy(blink::WebFloatSize(delta),
152 blink::WebFloatSize(velocity)); 152 blink::WebFloatSize(velocity));
153 return did_scroll && still_active; 153 return did_scroll && still_active;
154 } 154 }
155 155
156 void WebGestureCurveImpl::ComputeTotalScrollOffset(gfx::Vector2dF& offset) {
157 curve_->ComputeTotalScrollOffset(offset);
158 }
159
160 bool WebGestureCurveImpl::ResetCurveBySnappedOffset(
161 const gfx::Vector2dF& offset) {
162 return curve_->ResetCurveBySnappedOffset(offset);
163 }
164
156 } // namespace ui 165 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gestures/blink/web_gesture_curve_impl.h ('k') | ui/events/gestures/fling_curve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698