Commits

Gilles Debunne authored fd5bc01f70c
Better horizontal internal scroll handling in Text. Bug 6378843 Corrects CL 183460, which would clip text with a width greater than twice the TextView's width. Internal horizontal translation is now handled in a similar way to vertical scrolling. Internal scrolling is indeed handled by the TextView, which translates the canvas and sets the clipping bounds accordingly. When drawing the internal DL, we tighten the horizontal bounds like we did for the vertical bounds using top and bottom. As in Touch.java, we use the getHorizontallyScrolling() method to know if we indeed have to measure the actual text width. If there is no horizontal scrolling we use the TextView's width as a safe upper estimate in order to avoid an actual computation. Note that horizontal scrolling is typically only used for long single-lined text, so that the measurement loop is quick. As a result, the internal DLs represent the entire text, and there is no need to invalidate them when an internal scrolling takes place. This behavior replaces the draw-only-what-is-needed we had before, but is more consistent with what we do for long texts inside of a ScrollView with no noticeable performance change, even on very long text. Change-Id: I47c24c0ae988547d4f1e9f87d136225c93a3056d