[frameworks][native][libs]{math|ui} fix -Wimplicit-int-float-conversion

Some of the overloaded constructors accept templated types. This makes
it simple to specify Vec{2|3}/Quat's using integer literals. This could
result in precision loss for large integrals that aren't precisely
representable by IEEE 754 Single Precision floats.  If you're creating
such primitives from such large values, and getting imprecision...well,
you kind of asked for it.

Add explicit casts to silence the warning.

Bug: 139945549
Test: mm
Change-Id: Icaaa8906157aa166f54d915fca643efd639fdafa
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 55e3b99..1222cd6 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -339,10 +339,10 @@
     size_t count = mStorage.size();
     Rect* rects = mStorage.editArray();
     while (count) {
-        rects->left = static_cast<int32_t>(rects->left * sx + 0.5f);
-        rects->right = static_cast<int32_t>(rects->right * sx + 0.5f);
-        rects->top = static_cast<int32_t>(rects->top * sy + 0.5f);
-        rects->bottom = static_cast<int32_t>(rects->bottom * sy + 0.5f);
+        rects->left = static_cast<int32_t>(static_cast<float>(rects->left) * sx + 0.5f);
+        rects->right = static_cast<int32_t>(static_cast<float>(rects->right) * sx + 0.5f);
+        rects->top = static_cast<int32_t>(static_cast<float>(rects->top) * sy + 0.5f);
+        rects->bottom = static_cast<int32_t>(static_cast<float>(rects->bottom) * sy + 0.5f);
         rects++;
         count--;
     }