github emilk/egui 0.31.0
0.31.0 - Scene container, improved rendering quality

one day ago

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.

scene

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 your Painter::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
  • Rename Rounding to CornerRadius #5673
  • CornerRadius, Margin and Shadow have been updated to use i8 and u8 #5563, #5567, #5568
    • Remove the .0 from your values
    • Cast dynamic values with as i8 / as u8 or as _ if you want Rust to infer the type
      • Rust will do a 'saturating' cast, so if your f32 value is bigger than 127 it will be clamped to 127
  • RectShape parameters changed #5565
    • Prefer to use the builder methods to create it instead of initializing it directly
  • Frame now takes the Stroke 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

🔧 Changed

  • ⚠️ Frame now includes stroke width as part of padding #5575 by @emilk
  • Rename Rounding to CornerRadius #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 in CornerRadius, and introduce CornerRadiusF32 #5563 by @emilk
  • Store Margin using i8 to reduce its size #5567 by @emilk
  • Shrink size of Shadow by using i8/u8 instead of f32 #5568 by @emilk
  • Avoid allocations for loader cache lookup #5584 by @mineichen
  • Use bitfield instead of bools in Response and Sense #5556 by @polwel

Don't miss a new egui release

NewReleases is sending notifications on new releases.