0.31.0 - Scene container, improved rendering quality
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 Widgets and child Uis.
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
StrokeKindto all yourPainter::rectcalls #5648 StrokeKind::defaultwas removed, since the 'normal' value depends on the context #5658- You probably want to use
StrokeKind::Insidewhen drawing rectangles - You probably want to use
StrokeKind::Middlewhen drawing open paths
- You probably want to use
- Rename
RoundingtoCornerRadius#5673 CornerRadius,MarginandShadowhave been updated to usei8andu8#5563, #5567, #5568- Remove the .0 from your values
- Cast dynamic values with
as i8/as u8oras _if you want Rust to infer the type- Rust will do a 'saturating' cast, so if your
f32value is bigger than127it will be clamped to127
- Rust will do a 'saturating' cast, so if your
RectShapeparameters changed #5565- Prefer to use the builder methods to create it instead of initializing it directly
Framenow takes theStrokewidth 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::Scenefor panning/zooming aUi#5505 by @grtlr - Animated WebP support #5470 by @Aely0
- Improve tessellation quality #5669 by @emilk
- Add
OutputCommandfor copying text and opening URL:s #5532 by @emilk - Add
Context::copy_image#5533 by @emilk - Add
WidgetType::ImageandImage::alt_text#5534 by @lucasmerlin - Add
epaint::Brushfor controllingRectShapetexturing #5565 by @emilk - Implement
nohash_hasher::IsEnabledforId#5628 by @emilk - Add keys for
!,{,}#5548 by @Its-Just-Nans - Add
RectShape::stroke_kindto control if stroke is inside/outside/centered #5647 by @emilk
🔧 Changed
⚠️ Framenow includes stroke width as part of padding #5575 by @emilk- Rename
RoundingtoCornerRadius#5673 by @emilk - Require a
StrokeKindwhen 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
profilingcrate #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
u8inCornerRadius, and introduceCornerRadiusF32#5563 by @emilk - Store
Marginusingi8to reduce its size #5567 by @emilk - Shrink size of
Shadowby usingi8/u8instead off32#5568 by @emilk - Avoid allocations for loader cache lookup #5584 by @mineichen
- Use bitfield instead of bools in
ResponseandSense#5556 by @polwel
