Commit 3e2acb4
authored
[Android] Fix crash in GraphicsView when using TapGestureRecognizer (dotnet#34301)
### Description of Change
Fixes a crash on Android when using `TapGestureRecognizer` with
`GraphicsView`.
### Root Cause
`PlatformTouchGraphicsView.TouchesMoved` assumed that
`_lastMovedViewPoints`
always contained at least one element.
In certain touch event sequences (triggered when a TapGestureRecognizer
is attached),
`_lastMovedViewPoints` could be empty while `points.Length == 1`,
leading to an IndexOutOfRangeException.
### Fix
Added a length check before accessing `_lastMovedViewPoints[0]`
to prevent out-of-range access.
### Verified Scenarios
- TapGestureRecognizer no longer causes a crash
- Tap events fire correctly
- Drag interaction remains functional
- Multitouch does not crash
Fixes dotnet#342961 parent 2c6474f commit 3e2acb4
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
0 commit comments