Use a transformed bounding box when hit testing transformed elements
Hit testing uses a 1x1 rect (i.e., "bounding box" )at the hit test location to test intersection with boxes in the tree. The current implementation always uses a 1x1 bounding box in the local coordinate space of the box being tested, which is incorrect -- for example, if the box is scaled by 100x, then using a 1x1 bounding box in the local space is equivalent to using a 100x100 bounding box in the viewport, and as a result we hit the transformed box even if the hit test location is still 100px away from it. This patch fixes the issue by also transforming the bounding box, so that it is always equivalent to a 1x1 rect in the viewport. Bug: 1015801 Change-Id: Ia23e33d2d14bc51fcb2d4b0953ed48bc5738e20e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1891110Reviewed-by:Philip Rogers <pdr@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#711072}
Showing
Please register or sign in to comment