egui is an easy-to-use immediate mode GUI for Rust that runs on both web and native.
Try it now: https://www.egui.rs/
egui development is sponsored by Rerun, a startup building an SDK for visualizing streams of multimodal data.
Highlights ✨
Scene container
This release adds the Scene
container to egui. It is a pannable, zoomable canvas that can contain Widget
s and child Ui
s.
This will make it easier to e.g. implement a graph editor.
Clearer, pixel perfect rendering
The tessellator has been updated for improved rendering quality and better performance. It will produce fewer vertices
and shapes will have less overdraw. We've also defined what CornerRadius
(previously Rounding
) means.
We've also added a tessellator test to the demo app, where you can play around with different
values to see what's produced:
tessellator-test.mp4
Check the PR for more details.
CornerRadius
, Margin
, Shadow
size reduction
In order to pave the path for more complex and customizable styling solutions, we've reduced the size of
CornerRadius
, Margin
and Shadow
values to i8
and u8
.
Migration guide
- Add a
StrokeKind
to all yourPainter::rect
calls #5648 StrokeKind::default
was removed, since the 'normal' value depends on the context #5658- You probably want to use
StrokeKind::Inside
when drawing rectangles - You probably want to use
StrokeKind::Middle
when drawing open paths
- You probably want to use
- Rename
Rounding
toCornerRadius
#5673 CornerRadius
,Margin
andShadow
have been updated to usei8
andu8
#5563, #5567, #5568- Remove the .0 from your values
- Cast dynamic values with
as i8
/as u8
oras _
if you want Rust to infer the type- Rust will do a 'saturating' cast, so if your
f32
value is bigger than127
it will be clamped to127
- Rust will do a 'saturating' cast, so if your
RectShape
parameters changed #5565- Prefer to use the builder methods to create it instead of initializing it directly
Frame
now takes theStroke
width into account for its sizing, so check all views of your app to make sure they still look right.
Read the PR for more info.
⭐ Added
- Add
egui::Scene
for panning/zooming aUi
#5505 by @grtlr - Animated WebP support #5470 by @Aely0
- Improve tessellation quality #5669 by @emilk
- Add
OutputCommand
for copying text and opening URL:s #5532 by @emilk - Add
Context::copy_image
#5533 by @emilk - Add
WidgetType::Image
andImage::alt_text
#5534 by @lucasmerlin - Add
epaint::Brush
for controllingRectShape
texturing #5565 by @emilk - Implement
nohash_hasher::IsEnabled
forId
#5628 by @emilk - Add keys for
!
,{
,}
#5548 by @Its-Just-Nans - Add
RectShape::stroke_kind
to control if stroke is inside/outside/centered #5647 by @emilk
🔧 Changed
- ⚠️
Frame
now includes stroke width as part of padding #5575 by @emilk - Rename
Rounding
toCornerRadius
#5673 by @emilk - Require a
StrokeKind
when painting rectangles with strokes #5648 by @emilk - Round widget coordinates to even multiple of 1/32 #5517 by @emilk
- Make all lines and rectangles crisp #5518 by @emilk
- Tweak window resize handles #5524 by @emilk
🔥 Removed
🐛 Fixed
- Use correct minimum version of
profiling
crate #5494 by @lucasmerlin - Fix interactive widgets sometimes being incorrectly marked as hovered #5523 by @emilk
- Fix panic due to non-total ordering in
Area::compare_order()
#5569 by @HactarCE - Fix hovering through custom menu button #5555 by @M4tthewDE
🚀 Performance
- Use
u8
inCornerRadius
, and introduceCornerRadiusF32
#5563 by @emilk - Store
Margin
usingi8
to reduce its size #5567 by @emilk - Shrink size of
Shadow
by usingi8/u8
instead off32
#5568 by @emilk - Avoid allocations for loader cache lookup #5584 by @mineichen
- Use bitfield instead of bools in
Response
andSense
#5556 by @polwel