displayRect is not adjusted for padding. Tap event gives wrong coordinates when padding is set.
- Dominant language
- Java
- Stars
- 18.8k
- Forks
- 3.9k
- PR merge metrics
- No merged PRs in 30d
Description
When adding padding to the view, I noticed the tap coordinates are wrong. When diving into the source code I noticed that it is because the `displayRect` is not adjusted for padding.
This can easily be tested by overriding `onDraw` and painting the `displayRect` directly on the canvas. The image with padding and the rect painted are the same size and scale at all times one is translated with the padding.
To fix the tap issue, I forked the library and translated the displayRect in the `onSingleTapConfirmed` callback before calculating the coordinates. I could do a pull request but I only hot-fixed the tap and I'm pretty sure that padding has other implications that would need to be fixed.
Contributor guide
Assessment
This issue has not been assessed yet.