Fix SelectionArea select-word edge cases (#136920)

This change fixes issues with screen order comparison logic when rects are encompassed within each other. This was causing issues when trying to select text that includes inline `WidgetSpan`s inside of a `SelectionArea`.

* Adds `boundingBoxes` to `Selectable` for a more precise hit testing region.

Fixes #132821
Fixes updating selection edge by word boundary when widget spans are involved.
Fixes crash when sending select word selection event to an unselectable element.
This commit is contained in:
Renzo Olivares
2023-12-11 13:32:55 -08:00
committed by GitHub
parent 67edaef9b4
commit f60e54b24c
8 changed files with 369 additions and 58 deletions

View File

@@ -115,6 +115,9 @@ class _RenderSelectableAdapter extends RenderProxyBox with Selectable, Selection
// Selectable APIs.
@override
List<Rect> get boundingBoxes => <Rect>[paintBounds];
// Adjust this value to enlarge or shrink the selection highlight.
static const double _padding = 10.0;
Rect _getSelectionHighlightRect() {