-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix AccessKit node bounds #18706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix AccessKit node bounds #18706
Conversation
…y module. The camera translation shouldn't be applied to UI items and UI node's translation's point to the center of the ui node not the top left corner.
Testing with the tab_navigation on Windows with NVDA and exploring the UI with the mouse. I notice that my screen reader reads the role of the widgets ("Button" in this case) just before the hovering effect starts when entering the bounding box from the top and the left. It doesn't happen from the right or the bottom. Is it possible that the top-left corner of the accessible bounds fall outside of the real bounds by 1-2 pixels? |
If it's only a tiny margin it might be a rounding problem. I'll try flooring all the coordinate values. |
Nope, doesn't change anything. I'm not sure but this might actually be an issue with the button hovering mechanism itself. I'm visually impaired so I can't definitely say, but you might be able to observe that the borders and the "Hover" text are triggered when the mouse has already entered the hit box of the buttons when coming from the left or the top. So the accessible bounds seem OK to me. |
Yes that's it. Using my screen magnifier I can say that there is a gap of two pixels between the top-left corner of the buttons and the area that triggers the text change and the border highlight. Thank you very much for the quick fix! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether the coordinates need to be floored then.
Yeah it's better not to if it didn't help. |
I suspect the bounds are correct now and the hovering issue is caused somewhere else. If this gets another positive review we should merge and create a new issue about the 2-pixel gap I think, as it's much less critical. |
I just patched this in to my test app, and things look better but still incorrect - looks like the coords are scaled wrong (as you anticipated). Running on a MacBook pro, the focus ring appears to be scaled by 50%, both in position and size. |
I installed NVDA and tried the built in screen reader on windows but haven't been to get it to work with Bevy, not sure what I'm doing wrong. There are some other critical bugs I noticed too. The accessibility systems only update on changes to the widget marker components, so they won't respond to changes to the state of the widgets. |
Just needed to set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified.
# Objective Fixes #18685 ## Solution * Don't apply the camera translation. * Calculate the min and max bounds of the accessibility node rect taking the UI translation relative to its center not the top-left corner. ## Testing Install [NVDA](https://www.nvaccess.org/). In NVDA set `Preferences -> Settings -> Vision -> Enable Highlighting`. Then run bevy's `tab_navigation` example: ``` cargo run --example tab_navigation ``` If everything is working correctly, NVDA should draw a border around the currently selected tab button: 
Objective
Fixes #18685
Solution
Testing
Install NVDA. In NVDA set
Preferences -> Settings -> Vision -> Enable Highlighting
.Then run bevy's
tab_navigation
example:If everything is working correctly, NVDA should draw a border around the currently selected tab button: