OSDN Git Service

Use correct rounding in View for potentially negative values
authorAlan Viverette <alanv@google.com>
Mon, 16 Nov 2015 20:38:59 +0000 (15:38 -0500)
committerAlan Viverette <alanv@google.com>
Mon, 16 Nov 2015 20:38:59 +0000 (15:38 -0500)
commitc45b1d4ae4afa52f292df2bf1b09a5691eef1cfa
tree4bf6308fc0c670f3e382e99ed9cb05c09ef55692
parent19c3f7fa2f68b4a1e2ddab55f98139b0af16ef01
Use correct rounding in View for potentially negative values

Fast rounding doesn't work for negative values, so use Math.round()
where we might encounter negative values. Use Math.floor() and ceil()
for rounding down and up, respectively.

Bug: 25695621
Change-Id: I94831b8eb7552fc24cbe5808e923de1674d8ba6d
core/java/android/view/View.java
core/java/android/view/ViewGroup.java