maui
maui copied to clipboard
[Android] Fix for span GestureRecognizers don't work when the span is wrapped over two lines.
Root Cause of the issue
If the span is wrapped across two lines, the Android Text layout method GetLineVisibleEnd returns the position right after the last visible character on the line. Therefore, the Text layout GetSecondaryHorizontal method returned the value 0 when finding the spanEndX value. Here, the value of spanEndX is less than that of spanStartX. As a result, spanEndX was defaulted to 0, which caused the issue.
Description of Change
We can get the exact offset of the last visible character, by subtracting 1 from this position of the endOffset when finding spanEndX.
Issues Fixed
Fixes #23801
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
Screenshot
| Before Issue Fix | After Issue Fix |
|---|---|
Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).