Browse Source
Fix: correct usage of `PointToScreen` for Android TalkBack (#21402)
dev/timill/catalyst
Isabelle Santin
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
2 deletions
-
src/Android/Avalonia.Android/AvaloniaAccessHelper.cs
|
|
|
@ -8,6 +8,7 @@ using Avalonia.Android.Automation; |
|
|
|
using Avalonia.Automation; |
|
|
|
using Avalonia.Automation.Peers; |
|
|
|
using Avalonia.Automation.Provider; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Java.Lang; |
|
|
|
|
|
|
|
namespace Avalonia.Android |
|
|
|
@ -208,8 +209,8 @@ namespace Avalonia.Android |
|
|
|
// On-screen bounds
|
|
|
|
Rect bounds = peer.GetBoundingRectangle(); |
|
|
|
PixelRect screenRect = new PixelRect( |
|
|
|
_view.TopLevelImpl.PointToScreen(bounds.TopLeft), |
|
|
|
_view.TopLevelImpl.PointToScreen(bounds.BottomRight) |
|
|
|
_view.TopLevelImpl.InputRoot?.RootElement.PointToScreen(bounds.TopLeft) ?? default, |
|
|
|
_view.TopLevelImpl.InputRoot?.RootElement.PointToScreen(bounds.BottomRight) ?? default |
|
|
|
); |
|
|
|
nodeInfo.SetBoundsInScreen(new( |
|
|
|
screenRect.X, screenRect.Y, |
|
|
|
|