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

Unified Diff: ui/events/gesture_detection/velocity_tracker.cc

Issue 660173002: Type conversion fixes, ui/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: ui/events/gesture_detection/velocity_tracker.cc
diff --git a/ui/events/gesture_detection/velocity_tracker.cc b/ui/events/gesture_detection/velocity_tracker.cc
index a3fd83e2e22247b6f9c77e04c10b39e65246c678..68060f955f92370be4bb6583c5ad1ec66a4aea67 100644
--- a/ui/events/gesture_detection/velocity_tracker.cc
+++ b/ui/events/gesture_detection/velocity_tracker.cc
@@ -594,7 +594,7 @@ bool LeastSquaresVelocityTrackerStrategy::GetEstimator(
x[m] = position.x;
y[m] = position.y;
w[m] = ChooseWeight(index);
- time[m] = -age.InSecondsF();
+ time[m] = -static_cast<float>(age.InSecondsF());
index = (index == 0 ? HISTORY_SIZE : index) - 1;
} while (++m < HISTORY_SIZE);
@@ -645,7 +645,7 @@ float LeastSquaresVelocityTrackerStrategy::ChooseWeight(uint32_t index) const {
if (delta_millis < 0)
return 0.5f;
if (delta_millis < 10)
- return 0.5f + delta_millis * 0.05;
+ return 0.5f + delta_millis * 0.05f;
return 1.0f;
}
@@ -663,11 +663,11 @@ float LeastSquaresVelocityTrackerStrategy::ChooseWeight(uint32_t index) const {
if (age_millis < 0)
return 0.5f;
if (age_millis < 10)
- return 0.5f + age_millis * 0.05;
+ return 0.5f + age_millis * 0.05f;
if (age_millis < 50)
return 1.0f;
if (age_millis < 60)
- return 0.5f + (60 - age_millis) * 0.05;
+ return 0.5f + (60 - age_millis) * 0.05f;
return 0.5f;
}

Powered by Google App Engine
This is Rietveld 408576698