1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00
Commit Graph

4034 Commits

Author SHA1 Message Date
Emil Ernerfeldt
6a6033a378 Missed one (somehow) 2025-09-08 17:19:30 +02:00
Emil Ernerfeldt
df33830821 Update snapshot images 2025-09-08 17:11:12 +02:00
Emil Ernerfeldt
b00f5283c5 Merge branch 'main' into fonts-cleanup 2025-09-08 16:55:27 +02:00
Emil Ernerfeldt
197ec85a3e Fix glyph width of tab and thin space 2025-09-08 16:49:18 +02:00
Lucas Meurer
e5d0b93633 Preserve text format in truncated label tooltip (#7514)
* Related https://github.com/rerun-io/rerun/issues/10906

This changes the label hover ui to use the provided layout job instead
of the text so that the text format is preserved.
2025-09-08 15:41:05 +02:00
Emil Ernerfeldt
5b3c80a2ff Small code cleanup 2025-09-08 15:28:32 +02:00
Emil Ernerfeldt
80c00dfb16 Simplify kerning code 2025-09-08 14:40:48 +02:00
Emil Ernerfeldt
45a109633f Small naming and docstring improvements 2025-09-08 14:32:39 +02:00
Emil Ernerfeldt
4e15f5306f Better naming + bug fix (wrong unit) 2025-09-08 14:28:16 +02:00
valadaptive
237d217fbb Fix bespoke formatting lints 2025-09-08 05:41:03 -04:00
valadaptive
623c4c6d3c Disable subpixel binning for CJK glyphs 2025-09-08 05:38:15 -04:00
valadaptive
61351d170e Apply documentation changes 2025-09-08 05:30:32 -04:00
valadaptive
abe9a2d91d Apply review suggestion about GlyphCacheKey 2025-09-08 05:27:42 -04:00
valadaptive
d659df6655 Subpixel glyph positioning 2025-09-08 05:22:29 -04:00
valadaptive
03a4f2c181 Stop accumulating rounding error on purpose 2025-09-08 04:43:07 -04:00
Lucas Meurer
34cd613378 Update changelogs and versions for 0.32.2 (#7505) 2025-09-08 10:42:10 +02:00
Lucas Meurer
73c5892a4d Generate changelogs for emath (#7513)
Sometimes there are changes that only affect emath, so those should be
listed somewhere
2025-09-08 10:13:21 +02:00
valadaptive
dcb6420a41 Update inaccurate comment 2025-09-07 21:40:57 -04:00
valadaptive
91d3384a6c Remove busted glyph-centering code
Not sure *what* I replaced this with, but it's unnecessary now
2025-09-07 21:38:10 -04:00
valadaptive
4325c8f3c8 Optimize glyph allocation cache lookups 2025-09-07 21:36:04 -04:00
valadaptive
38fbae0541 Cache GlyphIds for allocation instead of full info 2025-09-07 21:36:04 -04:00
valadaptive
95458f4b52 Stop using ab_glyph scaling entirely 2025-09-07 21:36:04 -04:00
valadaptive
f560b6a9ff Cache scaled font metrics 2025-09-07 21:36:04 -04:00
valadaptive
3a6cb2e273 Refactor replace_last_glyph_with_overflow_character
Muuuuuch nicer.
2025-09-07 21:36:04 -04:00
valadaptive
1ccd809b61 Fix glyph cache key 2025-09-07 21:36:03 -04:00
Emil Ernerfeldt
58cbca1016 Change argument order 2025-09-07 21:36:03 -04:00
Emil Ernerfeldt
e372ffe99a Update to latest ab_glyph 2025-09-07 21:36:03 -04:00
Emil Ernerfeldt
6f53261f4a Refactor GlyphInfo 2025-09-07 21:36:03 -04:00
Emil Ernerfeldt
686f0709db Fix benchmark compilation 2025-09-07 21:36:03 -04:00
Emil Ernerfeldt
9d8dba48c1 Update test output 2025-09-07 21:36:03 -04:00
Emil Ernerfeldt
0d628e6db3 Change parameter order and fix bug in test 2025-09-07 21:34:16 -04:00
Emil Ernerfeldt
3385ad5bcb Pre-hash contents of FontFaceKey 2025-09-07 21:34:16 -04:00
Emil Ernerfeldt
560346d007 add docstring 2025-09-07 21:34:16 -04:00
valadaptive
1ddd143e45 Fix panic if no fonts loaded 2025-09-07 21:34:16 -04:00
valadaptive
e5a22395a6 Fix docs 2025-09-07 21:34:16 -04:00
valadaptive
52ce61a305 Please the linter 2025-09-07 21:34:16 -04:00
valadaptive
9a774097a1 Rename font_impls field to fonts_by_name 2025-09-07 21:34:15 -04:00
valadaptive
a113907005 Include pixels_per_point in galley cache key 2025-09-07 21:34:15 -04:00
valadaptive
9aaee3354d Let Fonts handle multiple pixels_per_point 2025-09-07 21:34:15 -04:00
valadaptive
837fc7fef7 Remove more Arc<Mutex<...>> from font code
By making `Font` a view type and indexing by font ID, we can avoid
wrapping `FontImpl` and `TextureAtlas` in an `Arc<Mutex<...>>`.
2025-09-07 21:34:15 -04:00
valadaptive
02d45d70bc Make Font+FontImpl resolution and size independent 2025-09-07 21:34:15 -04:00
valadaptive
955e678577 Remove FontTweak::baseline_offset_factor
Even testing this out *with* font fallback, which seems to be its
intended purpose, this does exactly the same thing as y_offset_factor.
It's likely that some subsequent change (perhaps
https://github.com/emilk/egui/pull/2724) removed the code path that
made it function differently.
2025-09-07 21:34:15 -04:00
valadaptive
bbf9ac4d4b Stop wrapping FontsImpl in an Arc<Mutex<_>>
We never need to clone it, and none of its methods took `self` as
mutable, meaning it wasn't making use of the semantic difference between
the two.

This API is about to get reworked, and simplifying it is a first step.
2025-09-07 21:34:15 -04:00
Emil Ernerfeldt
aedd43c88f kittest: Add UPDATE_SNAPSHOTS=force (#7508)
This adds a new mode, `UPDATE_SNAPSHOTS=force`, which will lower the
threshold to zero, overwriting every image that is not _exactly_ the
same.

Most comparisons has a threshold because different GPUs render slightly
differently. However, setting that threshold accurately can be hard.

Sometimes a test will pass locally, but fail on CI. In those cases you
want to force an update of the failing test. You can use
`UPDATE_SNAPSHOTS=force` for that.

And sometimes a small change _should_ update all images, but the change
is so tiny that it falls under the threshold. Still, you want to make a
point of showing that these images have changes. You can use
`UPDATE_SNAPSHOTS=force` for that.
2025-09-05 16:45:36 +02:00
Emil Ernerfeldt
eceb0b11c9 Document how to push git lfs files to 3rd party PRs (#7507) 2025-09-05 10:47:23 +02:00
Stelios Kourlis
5fd452310b Deprecated ImageButton and removed WidgetType::ImageButton (#7483)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/main/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* Closes <https://github.com/emilk/egui/issues/7466>
* [x] I have followed the instructions in the PR template
* I have ran `./scripts/check.sh` and it has no fails
* I have run `cargo fmt` and `cargo clippy`

Added the deprecated tag to ImageButton struct
Removed the `WidgetType::ImageButton` variant. ImageButton will use
`WidgetType::Button` for its WidgetInfo

*This is my first PR ever, please let me know if I did something wrong
so I can change it*

---------

Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
2025-09-04 15:03:10 +02:00
YgorSouza
669cdc1fff Remove line breaks when pasting into single line TextEdit (#7441)
The line breaks are now replaced by spaces, matching the usual behavior
of text fields in HTML.

* Closes <https://github.com/emilk/egui/issues/7389>
* [x] I have followed the instructions in the PR template

Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
2025-09-04 13:53:02 +02:00
Andrew Farkas
1c460b6dc0 Skip zero-length layout job sections (#7430)
Fixes #7378 

Includes a regression test that previously failed and now succeeds.

* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
2025-09-04 13:17:59 +02:00
Aleksandr Strizhevskiy
763e2df9f9 Fix: prevent calendar popup from closing on dropdown change (#7409)
Currently, DatePickerButton will close without saving whenever a user
clicks a dropdown from year/month/date. The issue is caused because the
system mistakenly interprets the user as clicking off of the calendar.
This is unexpected and creates an unpleasant experience for the user.
This change now allows the user to use the dropdowns as expected; it
will close on save or cancel. The calendar still closes when user clicks
off of it, as before. The changes here are made in:
crates/egui_extras/src/datepicker/button.rs

I will admit that I am not an experienced Rust developer. The changes
were made with the help of ChatGPT 4.0.
I have tested the changes locally, as I am using the date picker in my
project.


* Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>
* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
2025-09-04 13:13:28 +02:00
darkwater
3a2094e80e Add Memory::move_focus (#7476)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/main/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* [X] I have followed the instructions in the PR template

This allows us to programatically move focus around. Another way would
be to inject arrow key inputs, but that requires the backend to
implement a way to do that, and could have unintended side-effects.

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-09-04 13:02:18 +02:00