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

Unified Diff: remoting/client/ui/fling_tracker.h

Issue 2888423003: [CRD iOS] Fix bugs in FlingTracker (Closed)
Patch Set: Merge branch 'master' into fix-fling-curve Created 3 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 | remoting/client/ui/fling_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ui/fling_tracker.h
diff --git a/remoting/client/ui/fling_tracker.h b/remoting/client/ui/fling_tracker.h
index 8e285ce7cfc75e1440f8db566980e6b93f8f80a7..c6e95c946d91d92e2d3bdf419f008d845d3a46d4 100644
--- a/remoting/client/ui/fling_tracker.h
+++ b/remoting/client/ui/fling_tracker.h
@@ -13,13 +13,15 @@ namespace remoting {
// liquid.
class FlingTracker {
public:
- // time_constant: The larger the number the longer it takes to fling.
+ // time_constant: The larger the number the longer it takes to fling and the
+ // further the object can move.
explicit FlingTracker(float time_constant);
~FlingTracker();
// Sets the position of the object and start fling. This will reset the
// existing fling.
+ // |velocity_x| and |velocity_y| need to be in pixel per second.
void StartFling(float velocity_x, float velocity_y);
void StopFling();
@@ -36,13 +38,12 @@ class FlingTracker {
private:
float time_constant_;
float initial_speed_rate_ = 0.f;
+ float fling_duration_ = 0.f;
float velocity_ratio_x_ = 0.f;
float velocity_ratio_y_ = 0.f;
float previous_position_x_ = 0.f;
float previous_position_y_ = 0.f;
- base::TimeTicks start_time_;
-
// FlingTracker is neither copyable nor movable.
FlingTracker(const FlingTracker&) = delete;
FlingTracker& operator=(const FlingTracker&) = delete;
« no previous file with comments | « no previous file | remoting/client/ui/fling_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698