Skip to content

TextScaled labels keep their last text while a new size waits - #41

Merged
rippelz merged 1 commit into
rippelz:mainfrom
Str8Anonymous:fix/scaled-text-0.5
Nov 26, 2026
Merged

rippelz merged 1 commit into
rippelz:mainfrom
Str8Anonymous:fix/scaled-text-0.5

Conversation

@Str8Anonymous

Copy link
Copy Markdown
Contributor

Summary

  • Text sizing and layout have a per-frame budget (2 ms for screen GUIs, 4 ms for world ones). A label whose new TextScaled size or layout missed it drew nothing that frame. A press's UIScale dip, or any tween of a button's size, resizes its labels every frame, so on a slow laptop pressed buttons went blank.
  • A deferred label now draws the text it last drew, placed in its new box, and is laid out again next frame. The kept text is dropped with the other galleys when the font atlas changes, and when its object is gone.

Verification

  • New test gui::walk::layout_tests::deferred_scaled_text_keeps_its_last_text.
  • cargo test --workspace --release --no-fail-fast: everything passes except renderer_builds_on_opengl, which fails on this machine's session with "Parent device is lost" (no OpenGL device available; the render crate isn't touched here).
  • On a slow laptop, menu tabs with TextScaled labels and a UIScale press dip keep their text through the press; before, they went blank on click. (A fast desktop rarely misses the budget, and --fixed-dt turns the budget off, so it shows only in real-time runs.)

Text sizing and layout have a per-frame budget (2 ms for screen GUIs,
4 ms for world ones), and a label whose new TextScaled size or layout
missed it drew nothing that frame. A press's UIScale dip, or any tween
of a button's size, resizes its labels every frame, so on a slow laptop
pressed buttons went blank: a menu tab lost its text on click, leaving
an empty plate. A deferred label now draws the text it last drew,
placed in its new box, and is laid out again next frame. The kept text
is dropped with the other galleys when the font atlas changes, and when
its object is gone.
@rippelz
rippelz merged commit f967fc5 into rippelz:main Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants