Skip to content

Fix UI accessibility transforms and update ordering#23859

Merged
alice-i-cecile merged 5 commits intobevyengine:mainfrom
ickshonpe:accessibility-calc-bounds-fix
Apr 18, 2026
Merged

Fix UI accessibility transforms and update ordering#23859
alice-i-cecile merged 5 commits intobevyengine:mainfrom
ickshonpe:accessibility-calc-bounds-fix

Conversation

@ickshonpe
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe commented Apr 17, 2026

Objective

  • Bevy UI's accessibility module doesn't set the transform on accessiblity nodes, ignoring scaling and rotation.
  • UI accessibility nodes should be updated before bevy_winit updates the accesskit adaptors, otherwise there will be a frames delay.

Solution

Replaced the calc_bounds systems with a new system sync_bounds_and_transforms.

Each accesskit Node corresponding to an AccessibleNode UI entity is now given object-centered coordinates for its bounding rect (instead of window coordinates) and a transform.

Accesskit uses local transforms so if an accessible node also has an accessible parent, its transform has to be recomputed relative to its parent.

Testing

I modified the button example so that accesskit integration is enabled by default and the button is drawn at a 45 degrees angle.

cargo run --example button

Screen readers should only react when the pointer is directly over the rotated button if the changes are working.

The example changes should be reverted before merging.

…that updates the accesskit transforms for UI `AccessibilityNode`'s as well their rects.
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior A-Accessibility A problem that prevents users with disabilities from using Bevy A-App Bevy apps and plugins A-UI Graphical user interfaces, styles, layouts, and widgets labels Apr 17, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in UI Apr 17, 2026
@ickshonpe ickshonpe added C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes labels Apr 17, 2026
@ickshonpe ickshonpe changed the title Accessibility Fix UI accessibility transforms and update ordering Apr 17, 2026
@andriyDev
Copy link
Copy Markdown
Contributor

Could you try locally adding #23846 and see if this creates any new ambiguities (any involving this new system)?

@andriyDev
Copy link
Copy Markdown
Contributor

Actually I ended up doing this myself, and yeah looks like this does indeed resolve the ambiguities!

@andriyDev andriyDev added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 17, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 18, 2026
Merged via the queue into bevyengine:main with commit bb1d516 Apr 18, 2026
40 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in UI Apr 18, 2026
@mockersf
Copy link
Copy Markdown
Member

The example changes should be reverted before merging.

This was not done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Accessibility A problem that prevents users with disabilities from using Bevy A-App Bevy apps and plugins A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants