From: reed@google.com Date: Fri, 18 Mar 2011 20:53:44 +0000 (+0000) Subject: fix warnings of int->float and double->float X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~18819 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c31a9d6d398336ed094dafcc284282f0102ef7d2;p=platform%2Fupstream%2FlibSkiaSharp.git fix warnings of int->float and double->float git-svn-id: http://skia.googlecode.com/svn/trunk@961 2bbb7eff-a529-9590-31e7-b0007b416f81 --- 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);