maui icon indicating copy to clipboard operation
maui copied to clipboard

[Android] Fix for span GestureRecognizers don't work when the span is wrapped over two lines.

Open Tamilarasan-Paranthaman opened this issue 1 year ago • 9 comments

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

Tamilarasan-Paranthaman avatar Oct 10 '24 12:10 Tamilarasan-Paranthaman

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

jsuarezruiz avatar Oct 11 '24 06:10 jsuarezruiz

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Oct 11 '24 06:10 azure-pipelines[bot]

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Oct 17 '24 11:10 azure-pipelines[bot]

/azp run

PureWeen avatar Oct 21 '24 15:10 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Oct 21 '24 15:10 azure-pipelines[bot]

/rebase

Tamilarasan-Paranthaman avatar Oct 23 '24 16:10 Tamilarasan-Paranthaman

/azp run

PureWeen avatar Oct 25 '24 00:10 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Oct 25 '24 00:10 azure-pipelines[bot]

/azp run

jsuarezruiz avatar Oct 28 '24 11:10 jsuarezruiz

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Oct 28 '24 11:10 azure-pipelines[bot]