From c31a9d6d398336ed094dafcc284282f0102ef7d2 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Fri, 18 Mar 2011 20:53:44 +0000 Subject: [PATCH] fix warnings of int->float and double->float git-svn-id: http://skia.googlecode.com/svn/trunk@961 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/views/SkTouchGesture.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/SkTouchGesture.cpp b/src/views/SkTouchGesture.cpp index 70eb6d3..1732176 100644 --- a/src/views/SkTouchGesture.cpp +++ b/src/views/SkTouchGesture.cpp @@ -71,10 +71,10 @@ bool SkFlingState::evaluateMatrix(SkMatrix* matrix) { return false; } - const float t = getseconds() - fTime0; + const float t = (float)(getseconds() - fTime0); const float MIN_SPEED = 2; - const float K0 = 5.0; - const float K1 = 0.02; + const float K0 = 5; + const float K1 = 0.02f; const float speed = fSpeed0 * (sk_float_exp(- K0 * t) - K1); if (speed <= MIN_SPEED) { fActive = false; @@ -86,8 +86,8 @@ bool SkFlingState::evaluateMatrix(SkMatrix* matrix) { float tx = fDirection.fX * dist; float ty = fDirection.fY * dist; if (DISCRETIZE_TRANSLATE_TO_AVOID_FLICKER) { - tx = sk_float_round2int(tx); - ty = sk_float_round2int(ty); + tx = (float)sk_float_round2int(tx); + ty = (float)sk_float_round2int(ty); } matrix->setTranslate(tx, ty); // printf("---- evaluate (%g %g)\n", tx, ty); -- 2.7.4