Skip to content

single detect_text_needs_rerender system#23166

Open
ickshonpe wants to merge 7 commits intobevyengine:mainfrom
ickshonpe:detect-text-needs-rerender-refactor
Open

single detect_text_needs_rerender system#23166
ickshonpe wants to merge 7 commits intobevyengine:mainfrom
ickshonpe:detect-text-needs-rerender-refactor

Conversation

@ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Feb 27, 2026

Objective

detect_text_needs_rerender should only handle change detection for TextSpan entities.

Fixes #19437

Solution

  • Remove the generic type parameter from detect_text_needs_rerender.
  • Add detect_text_needs_rerender to PostUpdate in TextPlugin's builder.
  • Remove the scheduling of detect_text_needs_rerender from the Text and Text2d plugin builders.
  • Check Text for changes in measure_text and Text2d for changes in update_text2d_layout.

Testing

Text examples and tests still okay.

…interop`:

```
.after(bevy_text::load_font_assets_into_font_collection)
.after(bevy_asset::AssetEventSystems)
```

They are redundant because `text_system` runs in `UiSystems::PostLayout`, which is already ordered after `load_font_assets_into_font_collection` and `AssetEventSystems` through `UiSystems::Content`.
Removed the type parameter from `detect_text_needs_rerender`, which now detects changes for all text hierarchies. It no longer checks for changes to the root text entity (`Text` or `Text2d`) itself, which now needs to be checked by the text systems for those components.

`detect_text_render` is now added by `TextPlugin` to the `PostUpdate` schedule. `UiPlugin` and `SpritePlugin` no longer add it but schedule their systems to run after it.
@ickshonpe ickshonpe changed the title Detect text needs rerender refactor single detect_text_needs_rerender system Feb 27, 2026
@ickshonpe ickshonpe added A-Text Rendering and layout for characters S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 27, 2026
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes labels Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Text Rendering and layout for characters C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text change detection discriminator bug

1 participant