OSDN Git Service

Fix rounding error related to autoSize
authorSiyamed Sinir <siyamed@google.com>
Fri, 16 Mar 2018 01:00:07 +0000 (18:00 -0700)
committerSiyamed Sinir <siyamed@google.com>
Sat, 17 Mar 2018 04:27:37 +0000 (04:27 +0000)
commit948693ea28e72a42cd36a014e91016bc967a71a4
treef3f6d151859f217b34439ebef96af5baefa9f961
parent685288127d5bfa090a8fa2d709d5acf2b8f2c057
Fix rounding error related to autoSize

setupAutoSize fills in the possible text sizes that can be generated
between a min and max value. In order to do that, it counts the number
of steps starting from minSize until maxSize. However, while counting
it rounds the initial value, which causes rounding error at the final
step.

Test: Change system font scale to 1.1 via
      adb shell settings put system font_scale 1.1
Test: atest android.widget.cts.TextViewTest

Bug: 73917559
Bug: 75266270
Change-Id: I61811db28ef01262bd48f5042d783d75c71c3614
(cherry picked from commit db86a6b047dda704a1b8a6ff2d5b28b00febd444)
core/java/android/widget/TextView.java