Skip to content

Text change detection discriminator bug #19437

Open
@ickshonpe

Description

@ickshonpe

Bevy version

0.16

Problem

The detect_text_needs_rerender use the Text and Text2d components to discriminate between UI and 2d root text nodes. But both query for all TextSpans, this causes two problems:

  • All TextSpans are checked twice for changes.
  • If there is an error with a TextSpan detect_text_needs_rerender::<Root> reports the type of the current root discriminator:
            once!(warn!("found entity {} with a TextSpan that has a TextLayout, which should only be on root \
                text entities (that have {}); this warning only prints once",
                entity, core::any::type_name::<Root>()));

But since the system checks all TextSpans for both roots the reported root Text or Text2d is determined by the system order, not the type of the root the TextSpan belongs to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TextRendering and layout for charactersC-BugAn unexpected or incorrect behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions