Fix font size used in text width calculations not reflecting the UI's style #286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 be13.0while it defaulted to14.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

