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

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: Rebase 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
« no previous file with comments | « ui/events/gesture_detection/gesture_provider.cc ('k') | ui/events/keycodes/dom4/keycode_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78f477441ef60b4ab5736e9c5388c9230cf50e3c..072ae885e843bb767bc09496f5b4e902cfccff93 100644
--- a/ui/events/gesture_detection/velocity_tracker.cc
+++ b/ui/events/gesture_detection/velocity_tracker.cc
@@ -593,7 +593,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 ? kHistorySize : index) - 1;
} while (++m < kHistorySize);
@@ -644,7 +644,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;
}
@@ -662,11 +662,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;
}
« no previous file with comments | « ui/events/gesture_detection/gesture_provider.cc ('k') | ui/events/keycodes/dom4/keycode_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698