Skip to content

Conversation

@augenfrosch
Copy link
Collaborator

The helper functions that calculate text widths were using egui::FontId::default() before, which does not reflect the font size of the actual UI’s style, which seems to be 13.0 while it defaulted to 14.0.


I also reverted the width calculation from #284 to what it was originally, since my suggested change to it was not working for all languages because it was only (unintentionally) compensating for the discrepancy, and the original formula was correct (see https://github.com/emilk/egui/blob/f1e0b2e56597e185d18e53fe7f906e5a4455e243/crates/egui/src/containers/combo_box.rs#L364).

While the other uses of the helper functions are also affected, the differences are not as apparent.
 The only thing really noticeable to me was that the text in the simulator widget is now shifted further to the left
image
image

@augenfrosch augenfrosch added A-gui Area: Graphical user interface bug labels Dec 18, 2025
@KonaeAkira KonaeAkira merged commit f37287b into preview Dec 18, 2025
4 checks passed
@KonaeAkira KonaeAkira deleted the bug/incorrect-text-with-calculation branch December 18, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-gui Area: Graphical user interface bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants