Skip to content
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

Problems with the text system, change detection and MeasureFunc #7663

Closed
ickshonpe opened this issue Feb 13, 2023 · 1 comment · Fixed by #7779
Closed

Problems with the text system, change detection and MeasureFunc #7663

ickshonpe opened this issue Feb 13, 2023 · 1 comment · Fixed by #7779
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior

Comments

@ickshonpe
Copy link
Contributor

ickshonpe commented Feb 13, 2023

Bevy version

main d7d983

Details

UI layout changes don't get propagated correctly. Sometimes nodes completely disappear.

Worst offender, but definitely not the only bug, is this line in text_system:

Query<Entity, Or<(Changed<Text>, Changed<Style>)>>,

A lot of changes to the Style properties won't result in changes to the geometry of the node, and the text gets recomputed needlessly. On the other hand, non-local changes that affect the geometry of the text node aren't recognised and the text doesn't get recomputed when it should be.

An example is that if you set a text node to fill 50% of its parent node, and you change the size of the parent node, the text layout won't be recalculated.

@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 13, 2023
@ickshonpe ickshonpe changed the title Problems with the text system, change detection and MeasureFunc Big problems with the text system, change detection and MeasureFunc Feb 13, 2023
@ickshonpe ickshonpe changed the title Big problems with the text system, change detection and MeasureFunc Problems with the text system, change detection and MeasureFunc Feb 13, 2023
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Feb 13, 2023
@ickshonpe
Copy link
Contributor Author

There are other bugs in the UI that cover up this bug partially, which makes it quite hard to create a minimal example.

I've fixed some of the text problems properly in a fork, like the issue where only pixel values and not percentages can be used to constrain text nodes. But then when you've fixed that, this recomputation bug becomes much more apparent, and a lot of everything else breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants