DescriptionSimplify CullRect computation in LineBoxList::hitTest; fixing off-by-one
In the old formulation, we were essentially trying to "restore" the
margins from the HitTestLocation bounding-box and point, to compute a
"slice" to cull with. The "width" and "height" expressions for the slice
however trivially simplify to just the corresponding dimension of the
HitTestLocation bounding-box. For the "x" and "y" expressions however
the left/top margin is computed using the rounded point - which for
certain values of x/y will end up shifting the cullrect left/up by one
additional "unit" (pixel).
When the font size is small, one "unit" will be a lot, meaning that lines
can be missed entirely.
Change the computation of the cull rect to just use the bounding-box
from directly rather than restoring it from the (re)computed margin.
This gets rid of the last user of the HitTestLocation::*Padding()
methods, so remove those.
BUG=466617
Committed: https://crrev.com/cd159234dd394de40cb354fe71444b787b3b3bb7
Cr-Commit-Position: refs/heads/master@{#380194}
Patch Set 1 #
Depends on Patchset: Messages
Total messages: 9 (4 generated)
|