Emil Ernerfeldt
eceb0b11c9
Document how to push git lfs files to 3rd party PRs ( #7507 )
2025-09-05 10:47:23 +02:00
Emil Ernerfeldt
4947b191e4
Make more dependencies workspace dependencies ( #7495 )
2025-09-04 09:54:59 +02:00
Emil Ernerfeldt
0fad7d8503
Enable more clippy lints ( #7474 )
2025-08-24 16:27:28 +02:00
Emil Ernerfeldt
608de4a264
Update bytemuck ( #7475 )
2025-08-24 16:27:21 +02:00
Emil Ernerfeldt
a5a51ced0f
Improve egui-winit profile scope
2025-08-24 15:03:57 +02:00
Emil Ernerfeldt
5453cceded
Use official cargo machete action ( #7470 )
2025-08-21 15:42:10 +02:00
Emil Ernerfeldt
531ead5ad1
Update MSRV to 1.86 ( #7469 )
2025-08-21 15:38:41 +02:00
Emil Ernerfeldt
1da1d57c11
Panic mutexes that can't lock for 30 seconds, in debug builds ( #7468 )
...
I'm trying to debug a suspected deadlock in the CI for
https://github.com/emilk/egui/pull/7467
Since we use our own mutex wrappers, we can just panic if the lock is
too slow. Ugly and effective :)
2025-08-21 15:31:56 +02:00
Emil Ernerfeldt
7c5798289d
Bump version numbers to 0.32.1
2025-08-15 13:43:27 +02:00
Emil Ernerfeldt
6a355c3808
Add 0.32.1 to changelogs
2025-08-15 13:42:49 +02:00
Emil Ernerfeldt
b24a56d3f7
Only update snapshot if we didn't pass ( #7455 )
...
* Closes https://github.com/emilk/egui/issues/7449
2025-08-15 12:21:51 +02:00
Emil Ernerfeldt
839ee3eaf7
Make sure we always track the root viewport ( #7450 )
...
Some sanity checks I added while working on another bug
2025-08-14 12:03:38 +02:00
Emil Ernerfeldt
42bdf5b881
Fix link checker CI ( #7308 )
2025-08-12 12:34:53 +02:00
Emil Ernerfeldt
6fae65a3fa
Add emath::fast_midpoint ( #7435 )
2025-08-08 12:04:51 +02:00
Emil Ernerfeldt
3024c39eaf
Enable and fix some more clippy lints ( #7426 )
...
One can never have too many lints
2025-08-08 09:57:53 +02:00
Emil Ernerfeldt
36a4981f29
Enable clippy::iter_over_hash_type lint ( #7421 )
...
This helped discover a few things that _might_ have been buggy.
2025-08-06 13:55:53 +02:00
Emil Ernerfeldt
d42ea3800f
Update to winit 0.30.12 ( #7420 )
2025-08-06 13:53:59 +02:00
Emil Ernerfeldt
c8e6f6bfe5
Remove deprecated clippy lint
2025-08-06 11:45:02 +02:00
Emil Ernerfeldt
ef039aa566
Enable more clippy lints ( #7418 )
...
More is more!
2025-08-05 19:47:26 +02:00
Emil Ernerfeldt
b9a5081490
Fix glyph rendering: clamp coverage to [0, 1] ( #7415 )
...
* Closes #7366
* Closes https://github.com/emilk/egui/pull/7388
2025-08-05 13:03:39 +02:00
Emil Ernerfeldt
fdcaff8465
Improve RELEASES.md
2025-07-10 17:06:31 +02:00
Emil Ernerfeldt
fabd4aa7a5
Release 0.32.0 - Atoms, popups, and better SVG support ( #7329 )
2025-07-10 16:58:39 +02:00
Emil Ernerfeldt
9478a6223b
Rename egui::containers::menu::Bar to egui::MenuBar ( #7327 )
...
The old name is still there, just deprecated.
2025-07-10 10:33:48 +02:00
Emil Ernerfeldt
8d2f39fc08
Improve release checklist ( #7322 )
...
* See https://github.com/emilk/egui/issues/7321
2025-07-09 19:36:38 +02:00
Emil Ernerfeldt
a7f14ca176
Deprecate Memory::popup API in favor of new Popup API ( #7317 )
...
* Closes #7037
* Closes #7297
This deprecates all popup-related function in `Memory`, replacing them
with the new `egui::Popup`.
The new API is nicer in all ways, so we should encourage people to use
it.
2025-07-09 12:55:06 +02:00
Emil Ernerfeldt
fbe0aadf63
Add Popup::from_toggle_button_response ( #7315 )
...
Adds a convenience constructor for `Popup`
2025-07-09 10:12:47 +02:00
Emil Ernerfeldt and Adrian Blumer
f46926aaf1
Improve texture filtering by doing it in gamma space ( #7311 )
...
* Closes https://github.com/emilk/egui/pull/5839
This makes some transparent images look a lot nicer when blended:

Cursive text will also look nicer.
This unfortunately changes the contract of what
`register_native_texture` expects
---------
Co-authored-by: Adrian Blumer <blumer.adrian@gmail.com >
2025-07-07 17:46:27 +02:00
Emil Ernerfeldt
dd1052108e
Add snapshot test for image blending ( #7309 )
...
This adds a test that can be used to see the improvements made by this
PR (if any):
* https://github.com/emilk/egui/pull/5839
2025-07-07 13:58:22 +02:00
Emil Ernerfeldt
09596a5e7b
egui_kittest: more ergonomic functions taking Impl Into<String> ( #7307 )
2025-07-07 13:50:53 +02:00
Emil Ernerfeldt
b11b77e85f
Save a few CPU cycles with earlier early-out from Popup::show ( #7306 )
2025-07-07 12:07:13 +02:00
Emil Ernerfeldt
933d305159
Improve doc-string for Image::alt_text
2025-07-07 12:06:59 +02:00
Emil Ernerfeldt
93d562221b
Change Rect::area to return zero for negative rectangles ( #7305 )
...
Previously a single-negative rectangle (where `min.x > max.x` XOR `min.y
> max.y`) would return a negative area, while a doubly-negative
rectangle (`min.x > max.x` AND `min.y > max.y`) would return a positive
area. Now both return zero instead.
2025-07-07 12:03:03 +02:00
Emil Ernerfeldt
3622a03a46
Mark Popup with #[must_use]
2025-07-07 12:02:51 +02:00
Emil Ernerfeldt
6d80707422
Fix tooltips sometimes changing position each frame ( #7304 )
...
There was a bug in how we decide where to place a `Tooltip` (or other
`Popup`), which could lead to tooltips jumping around every frame,
especially if it changed size slightly.
The new code is simpler and bug-free.
2025-07-07 12:02:01 +02:00
Emil Ernerfeldt
a811b975c2
Better deprecation of SelectableLabel
2025-07-07 09:33:08 +02:00
Emil Ernerfeldt
d94386de3d
Fix debug_assert triggered by menu/intersect_ray ( #7299 )
2025-07-04 09:55:03 +02:00
Emil Ernerfeldt
ba577602a4
Fix crash when using infinite widgets ( #7296 )
...
* Closes https://github.com/emilk/egui/issues/7100
2025-07-03 13:40:02 +02:00
Emil Ernerfeldt
378e22e6ec
Improve the ThemePreference selection UI slightly
2025-07-03 09:16:13 +02:00
Emil Ernerfeldt
40c69cd1ba
Respect and detect prefers-color-scheme: no-preference ( #7293 )
...
I don't think this will make a difference in practice, but technically
there are three preference states:
* `dark`
* `light`
* `no-preference`
Previously we would only check for `dark`, and if not set would assume
`light`.
Not we also check `light` and if we're neither `dark` or `light` we
assume nothing.
2025-07-03 08:58:45 +02:00
Emil Ernerfeldt
dc79998044
Improve text rendering in light mode ( #7290 )
...
This changes how we convert glyph coverage to alpha (and ultimately a
color), but only in light mode.
This is a bit of a hack, because it doesn't fix dark-on-light text in
_dark mode_ (if you have any), but for the common case this PR is a huge
improvement.
You can also tweak this yourself now using
`Visuals::text_alpha_from_coverage` or from the UI (bottom of the
image):

## Before / After


## Black text Before/after
If you think the text above looks too weak, it's only because of the
default text color. Here's how it looks like with perfectly `#000000`
black text:


2025-07-02 14:58:37 +02:00
Emil Ernerfeldt
8bedaf6e5b
Add light-mode Widget Gallery screenshot test ( #7288 )
...
Part of some work to improve text rendering in light mode (again!)
2025-07-02 12:00:36 +02:00
Emil Ernerfeldt
22c6a9ae69
egui_kittest: Add HarnessBuilder::theme (#7289 )
...
Makes it ergonomic to snapshot test light vs dark mode
2025-07-02 12:00:22 +02:00
Emil Ernerfeldt
0857527f1d
Add Visuals::weak_text_alpha and weak_text_color ( #7285 )
...
* Closes https://github.com/emilk/egui/issues/7262
This also makes the default weak color slightly less weak in most cases.
2025-07-01 20:42:54 +02:00
Emil Ernerfeldt
9d1dce51eb
Extend .typos.toml to enforce american english ( #7284 )
...
More or less the same list we use at Rerun
2025-07-01 15:54:00 +02:00
Emil Ernerfeldt
737c61867b
Add Visuals::text_edit_bg_color ( #7283 )
...
* Closes https://github.com/emilk/egui/issues/7263
2025-07-01 15:13:16 +02:00
9e021f78da
Change ui.disable() to modify opacity ( #7282 )
...
* Closes https://github.com/emilk/egui/pull/6765
Branched off of https://github.com/emilk/egui/pull/6765 by @tye-exe.
I needed to branch off to update snapshot images
---------
Co-authored-by: tye-exe <tye@mailbox.org >
Co-authored-by: Tye <131195812+tye-exe@users.noreply.github.com >
2025-07-01 14:05:53 +02:00
Emil Ernerfeldt
b2995dcb83
Use Rust edition 2024 ( #7280 )
2025-06-30 14:01:57 +02:00
Emil Ernerfeldt
962c8e26a8
Update MSRV to 1.85 ( #7279 )
2025-06-30 13:43:27 +02:00
Emil Ernerfeldt
8ba42f322d
Add Context::cumulative_frame_nr ( #7278 )
2025-06-30 13:29:56 +02:00
Emil Ernerfeldt
d770cd53a6
Add Context::current_pass_index ( #7276 )
...
This can be used by developers who wants to add diagnostics when there
is a multi-pass egui frame.
2025-06-30 10:41:27 +02:00
Emil Ernerfeldt
2525546fef
Simplify some bezier math
2025-06-30 10:03:54 +02:00
Emil Ernerfeldt
ae8363ddb5
eframe web: only cosume copy/cut events if the canvas has focus ( #7270 )
...
Previously eframe would "steal" these events (by calling
`stop_propagation/prevent_default`) even when the eframe canvas did not
have focus.
2025-06-27 10:25:47 +02:00
Emil Ernerfeldt
8c2df4802c
Add back old Tooltip::new ( #7156 )
...
I was a bit too hasty in https://github.com/emilk/egui/pull/7151 and
changed a public API in a breaking way, for no good reason
2025-06-16 19:36:19 +02:00
Emil Ernerfeldt
06760e1b08
Change API of Tooltip slightly ( #7151 )
...
We try to be consistent with our parameter order to reduce surprise for
users.
I also renamed a few things to clarify what is what
2025-06-16 08:30:46 +02:00
Emil Ernerfeldt
699be07978
Add Vec2::ONE
2025-06-15 18:01:58 -07:00
Emil Ernerfeldt
f0abce9bb8
Button inherits the alt_text of the Image in it, if any (#7136 )
...
If a `Button` has an `Image` in it (and no text), then the
`Image::alt_text` will be used as the accessibility label for the
button.
2025-06-11 23:00:59 +02:00
Emil Ernerfeldt
bdbe655852
Mark HarnessBuilder build functions with #[must_use]
2025-06-07 17:19:12 -07:00
Emil Ernerfeldt
b8dfb138b6
Remove outdated link in README
2025-06-07 10:24:41 -07:00
Emil Ernerfeldt
209e818bd8
Improve deprecation message for old egui::menu
2025-06-07 10:24:28 -07:00
Emil Ernerfeldt
6e34152fa0
Add Context::format_modifiers ( #7125 )
...
Convenience
2025-06-07 19:22:16 +02:00
Emil Ernerfeldt
53098fad7b
Support vertical-only scrolling by holding down Alt ( #7124 )
...
* Closes https://github.com/emilk/egui/issues/7120
You can now zoom only the X axis by holding down shift, and zoom only
the Y axis by holding down ALT.
In summary
* `Shift`: horizontal
* `Alt`: vertical
* `Ctrl`: zoom (`Cmd` on Mac)
Thus follows:
* `scroll`: pan both axis (at least for trackpads and mice with two-axis
scroll)
* `Shift + scroll`: pan only horizontal axis
* `Alt + scroll`: pan only vertical axis
* `Ctrl + scroll`: zoom all axes
* `Ctrl + Shift + scroll`: zoom only horizontal axis
* `Ctrl + Alt + scroll`: zoom only vertical axis
This is provided the application uses `zoom_delta_2d` for its zooming
needs.
The modifiers are exposed in `InputOptions`, but it is strongly
recommended that you do not change them.
## Testing
Unfortunately we have no nice way of testing this in egui.
But I've tested it in `egui_plot`.
2025-06-07 19:18:13 +02:00
Emil Ernerfeldt
1d5b011793
Add OperatingSystem::is_mac ( #7122 )
...
* Part of https://github.com/emilk/egui/issues/7120
2025-06-07 18:36:23 +02:00
Emil Ernerfeldt
cbd9c60399
Add Modifiers::matches_any ( #7123 )
...
* Part of https://github.com/emilk/egui/issues/7120
2025-06-07 18:36:16 +02:00
Emil Ernerfeldt
9681644936
Move all input-related options into InputOptions ( #7121 )
2025-06-07 18:25:19 +02:00
Emil Ernerfeldt
417fdb1a43
Fix typo in changelog
2025-06-03 07:59:02 -07:00
Emil Ernerfeldt
92fea8a18f
Remove things that have been deprecated for over a year ( #7099 )
...
Removes all things that were marked `#[deprecated]` more than 12 months
ago
2025-05-28 09:47:15 +02:00
Emil Ernerfeldt
2cf6a3a9a6
Track original SVG size ( #7098 )
...
This fixes bugs related to how an `Image` follows the size of an SVG.
We track the "source size" of each image, i.e. the original width/height
of the SVG, which can be different from whatever it was rasterized as.
2025-05-28 08:33:01 +02:00
Emil Ernerfeldt
da67465a6c
Add Response::clicked_with_open_in_background ( #7093 )
...
Useful for buttons that should act as Hyperlinks
2025-05-26 19:44:55 +02:00
Emil Ernerfeldt
87de733da3
Better define the meaning of SizeHint ( #7079 )
2025-05-23 13:52:36 +02:00
Emil Ernerfeldt
ec8b41f7ec
Make Image::paint_at pixel-perfect crisp for SVG images ( #7078 )
2025-05-23 10:15:17 +02:00
Emil Ernerfeldt
b8334f365b
Fix sometimes blurry SVGs ( #7071 )
...
* Closes https://github.com/emilk/egui/issues/3501
The problem occurs when you want to render the same SVG at different
scales, either at the same time in different parts of your UI, or at two
different times (e.g. the DPI changes).
The solution is to use the `SizeHint` as part of the key.
However, when you have an SVG in a resizable container, that can lead to
hundreds of versions of the same SVG. So new eviction code is added to
handle this case.
2025-05-21 20:01:40 +02:00
Emil Ernerfeldt
b05a40745f
Bug fix: make sure end_pass is called for all loaders ( #7072 )
...
None of the built-in loaders does any cache eviction (yet), but 3rd
party ones might have
2025-05-21 19:52:59 +02:00
Emil Ernerfeldt
f57cb27386
Include test windows in egui_demo_lib snapshot tests ( #7070 )
2025-05-21 17:44:27 +02:00
Emil Ernerfeldt
54ae2360ec
Fix incorrect color fringe colors on SVG:s ( #7069 )
...
This is a problem that affected the fringes on all SVG:s with
transparency, especially on a light background.
## Before

## After

2025-05-21 17:18:36 +02:00
Emil Ernerfeldt and Daniel Jacobs
f23618701f
Update emoji-icon-font with fix for fullwidth latin characters ( #7067 )
...
* This PR is based on https://github.com/emilk/egui/pull/5877 by
@danielhjacobs
## Original PR description
Replace the current `emoji-icon-font.ttf` with the updated font from
https://github.com/jslegers/emoji-icon-font/pull/19 to address
https://github.com/emilk/egui/issues/1284 . The second commit then
removes the now unnecessary hack.
* Closes https://github.com/emilk/egui/issues/1284
* Closes https://github.com/emilk/egui/pull/5877
---------
Co-authored-by: Daniel Jacobs <danielhunterjacobs@gmail.com >
2025-05-21 13:22:23 +02:00
Emil Ernerfeldt
81b7e7f05a
Make the default spinner more high-res ( #7044 )
...
Make it nice and smooth when big
2025-05-11 22:15:07 +02:00
Emil Ernerfeldt
0fd6a805a4
Add lycheee.toml to ignore 429 ( #7035 )
...
Trying to get CI green
2025-05-08 09:26:36 +02:00
Emil Ernerfeldt
d0876a1a60
Rename master branch to main ( #7034 )
...
For consistency with other repositories, i.e. so I can write `git
checkout main` without worrying which repo I'm browsing.
2025-05-08 09:15:42 +02:00
Emil Ernerfeldt
7216d0e386
Use mimalloc for benchmarks ( #7029 )
...
`mimalloc` is a _much_ faster allocator, especially important when doing
a lot of small allocations (which egui does).
We use `mimalloc` in Rerun, and I recommend everyone to use it.
## The difference it makes

2025-05-06 17:54:06 +02:00
Emil Ernerfeldt
ba70106399
Fix enforce_branch_name.yml
2025-05-06 10:25:02 +02:00
Emil Ernerfeldt
f3611e3e5a
Enforce that PRs are not opened from the 'master' branch of a fork ( #6899 )
...
## What
Fail all PRs that are opened from the master/main branch of the fork.
## Why
PR:s opened from the `master` branch cannot be collaborated on. That is,
we maintainers cannot push our own commits to it (e.g. to fix smaller
problems with it before merging).
## How
Untested code straight from Claude 3.7 😅
2025-04-30 14:10:59 +02:00
Emil Ernerfeldt
f9245954eb
Enable more clippy lints ( #6853 )
...
* Follows https://github.com/emilk/egui/pull/6848
2025-04-24 17:32:50 +02:00
Emil Ernerfeldt
a8e0c56a8f
Update crossbeam-channel to resolve RUSTSEC
2025-04-13 19:12:22 +02:00
Emil Ernerfeldt
e275409eb1
Fix: transform TextShape underline width ( #5865 )
...
Minor bug fix when transforming a `TextShape` with a `underline` (used
for e.g. hyperlinks). Before the underline width would not scale
properly; now it will.
2025-03-30 16:36:03 +02:00
Emil Ernerfeldt
e3acd71090
Make text background rects pixel-sharp ( #5864 )
...
Small visual teak: make sure the background text color is pixel-aligned.
2025-03-30 16:21:00 +02:00
Emil Ernerfeldt
83254718a3
Clean up strikethrough/underline code in epaint
2025-03-30 13:15:41 +02:00
Emil Ernerfeldt
7ea3f762b8
Make text underline and strikethrough pixel perfect crisp ( #5857 )
...
Small visual fix: pixel-align any text underline or strikethrough.
Before they could be often be blurry.
2025-03-28 20:37:38 +01:00
Emil Ernerfeldt
2058dcb881
Improve text sharpness ( #5838 )
...
This improves the sharpness of text slightly, thanks to
<https://hikogui.org/2022/10/24/the-trouble-with-anti-aliasing.html > by
@hikogui (🙏 ).
The difference is very small, but in dark mode (bright text on dark
background) text is sometimes significantly sharper, and also slightly
brighter.
The difference in light mode (dark text on light background) is much
smaller (barely perceptable).
To compare the before/after I suggest you open both in new tabs, then
quickly change between them.
### Low-DPI
#### Before

#### After

#### Before

#### After

### High-DPI
The difference is starkest on low-DPI screens (like the above
screenshots). On high-DPI screens, the difference is much smaller
#### Before

#### After

2025-03-21 12:56:47 +01:00
Emil Ernerfeldt and Andreas Reich
3f731ec794
Fix semi-transparent colors appearing too bright ( #5824 )
...
The bug was in `Color32::from_rgba_unmultiplied` and by extension
affects:
* `Color32::from_rgba_unmultiplied`
* `hex_color!`
* `HexColor`
* `ColorImage::from_rgba_unmultiplied`
* All images with transparency (png, webp, …)
* `Color32::from_white_alpha`
The bug caused translucent colors to appear too bright.
## More
Color is hard.
When I started out egui I thought "linear space is objectively better,
for everything!" and then I've been slowly walking that back for various
reasons:
* sRGB textures not available everywhere
* gamma-space is more _perceptually_ even, so it makes sense to use for
anti-aliasing
* other applications do everything in gamma space, so that's what people
expect (this PR)
Similarly, pre-multiplied alpha _makes sense_ for blending colors. It
also enables additive colors, which is nice. But it does complicate
things. Especially when mixed with sRGB/gamma (As @karhu [points
out](https://github.com/emilk/egui/pull/5824#issuecomment-2738099254 )).
## Related
* Closes https://github.com/emilk/egui/issues/5751
* Closes https://github.com/emilk/egui/issues/5771 ? (probably; hard to
tell without a repro)
* But not https://github.com/emilk/egui/issues/5810
## TODO
* [x] I broke the RGBA u8 color picker. Fix it
---------
Co-authored-by: Andreas Reich <andreas@rerun.io >
2025-03-21 10:45:25 +01:00
Emil Ernerfeldt
42a88b677c
Fix some clippy lints from the future
2025-02-25 14:10:42 +01:00
Emil Ernerfeldt
6a96612cb3
Mark all keys as up if the app loses focus ( #5743 )
...
In Rerun, pressing `Cmd+S` brings up a save dialog using `rfd`, but we
get not key-up event for the `S` key (in winit).
This leads to `S` being mistakenly marked as down when we switch back to
the app.
This PR takes the safe route and marks all keys as up when an egui app
loses focus.
* Tested with https://github.com/rerun-io/rerun/pull/9103
2025-02-25 14:05:35 +01:00
Emil Ernerfeldt
81806c4b86
Add badges to kittest README.md
2025-02-07 09:22:10 +01:00
Emil Ernerfeldt
0db56dc9f1
Fix the magnification range of the tessellation test
2025-02-04 17:35:55 +01:00
Emil Ernerfeldt
985e569542
Fix warning
2025-02-04 17:04:29 +01:00
Emil Ernerfeldt
d7453e42d3
Fix gif in CHANGELOG.md
2025-02-04 17:03:38 +01:00
Emil Ernerfeldt
d97cd82338
Update RELEASES.md
2025-02-04 16:31:10 +01:00
Emil Ernerfeldt
f162c3bcbf
Explain how to set up generate_changelog.py
2025-02-04 16:30:32 +01:00
Emil Ernerfeldt
95ab92ca4a
Protect against mistyping "tessellator"
2025-02-04 16:28:27 +01:00
Emil Ernerfeldt
7ec1fbf467
Fix minor glitch in rendering of selected windows ( #5678 )
2025-02-04 16:05:36 +01:00
Emil Ernerfeldt
c6bda9a38c
Make the ends of vline/hline sharper ( #5676 )
...
TL;DR: line caps are annoying in two ways:
A) we only add them for lines wider than a pixel
B) they always make the line longer (if added)
2025-02-04 15:31:51 +01:00