From 92206a435baac1688c148f19e072c49c2f6ea7ab Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Sun, 10 Jun 2018 17:10:58 -0400 Subject: [skottie] Fix color parsing Currently truncating unnecessarily. TBR= Change-Id: I1929a4de62364e4685eb67f9a79b01a8dbac1c61 Reviewed-on: https://skia-review.googlesource.com/133823 Reviewed-by: Florin Malita Commit-Queue: Florin Malita --- modules/skottie/src/SkottieValue.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/skottie/src/SkottieValue.cpp b/modules/skottie/src/SkottieValue.cpp index edfa891aa1..a5fa8d5f34 100644 --- a/modules/skottie/src/SkottieValue.cpp +++ b/modules/skottie/src/SkottieValue.cpp @@ -59,10 +59,10 @@ SkColor ValueTraits::As(const VectorValue& v) { b = v.size() > 2 ? v[2] : 0, a = v.size() > 3 ? v[3] : 1; - return SkColorSetARGB(SkTPin(a, 0, 1) * 255, - SkTPin(r, 0, 1) * 255, - SkTPin(g, 0, 1) * 255, - SkTPin(b, 0, 1) * 255); + return SkColorSetARGB(SkScalarRoundToInt(SkTPin(a, 0.0f, 1.0f) * 255), + SkScalarRoundToInt(SkTPin(r, 0.0f, 1.0f) * 255), + SkScalarRoundToInt(SkTPin(g, 0.0f, 1.0f) * 255), + SkScalarRoundToInt(SkTPin(b, 0.0f, 1.0f) * 255)); } template <> -- cgit v1.2.3