-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Release 0.33.2 #7712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Release 0.33.2 #7712
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We just released egui 0.33.0! Highlights: - `egui::Plugin` a improved way to create and access egui plugins - [kitdiff](https://github.com/rerun-io/kitdiff), a viewer for egui_kittest image snapshots (and a general image diff tool) - better kerning (check the diff on [kitdiff](https://rerun-io.github.io/kitdiff/?url=https://github.com/emilk/egui/pull/7431)) https://github.com/user-attachments/assets/971f0493-6dae-42e5-8019-58b74cf5d203 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](https://www.rerun.io/), a startup building an SDK for visualizing streams of multimodal data. Highlights from this release: - `egui::Plugin` a improved way to create and access egui plugins - [kitdiff](https://github.com/rerun-io/kitdiff), a viewer for egui_kittest image snapshots (and a general image diff tool) - better kerning As a step towards using [parley](https://github.com/linebender/parley) for font rendering, @valadaptive has refactored the font loading and rendering code. A result of this (next to the font rendering code being much nicer now) is improved kerning. Notice how the c moved away from the k:  We've added a new trait-based plugin api, meant to replace `Context::on_begin_pass` and `Context::on_end_pass`. This makes it a lot easier to handle state in your plugins. Instead of having to write to egui memory it can live right on your plugin struct. The trait based api also makes easier to add new hooks that plugins can use. In addition to `on_begin_pass` and `on_end_pass`, the `Plugin` trait now has a `input_hook` and `output_hook` which you can use to inspect / modify the `RawInput` / `FullOutput`. At rerun we have a ton of snapshots. Some PRs will change most of them (e.g. [the](https://github.com/rerun-io/rerun/pull/11253/files) [one](https://rerun-io.github.io/kitdiff/?url=https://github.com/rerun-io/rerun/pull/11253/files) that updated egui and introduced the kerning improvements, ~500 snapshots changed!). If you really want to look at every changed snapshot it better be as efficient as possible, and the experience on github, fiddeling with the sliders, is kind of frustrating. In order to fix this, we've made [kitdiff](https://rerun-io.github.io/kitdiff/). You can use it locally via - `kitdiff files .` will search for .new.png and .diff.png files - `kitdiff git` will compare the current files to the default branch (main/master) Or in the browser via - going to https://rerun-io.github.io/kitdiff/ and pasting a PR or github artifact url - linking to kitdiff via e.g. a github workflow `https://rerun-io.github.io/kitdiff/?url=<link_to_pr_or_artefact>` To install kitdiff run `cargo install --git https://github.com/rerun-io/kitdiff` Here is a video showing the kerning changes in kitdiff ([try it yourself](https://rerun-io.github.io/kitdiff/?url=https://github.com/rerun-io/rerun/pull/11253/files)): https://github.com/user-attachments/assets/74640af1-09ba-435a-9d0c-2cbeee140c8f - `egui::Mutex` now has a timeout as a simple deadlock detection - If you use a `egui::Mutex` in some place where it's held for longer than a single frame, you should switch to the std mutex or parking_lot instead (egui mutexes are wrappers around parking lot) - `screen_rect` is deprecated - In order to support safe areas, egui now has `viewport_rect` and `content_rect`. - Update all usages of `screen_rect` to `content_rect`, unless you are sure that you want to draw outside the `safe area` (which would mean your Ui may be covered by notches, system ui, etc.)
The pr data is not accessible in this workflow so I have to hardcode the url with the pr number
`arboard` [doesn't support support iOS yet](1Password/arboard#103), so this PR adds iOS to the conditions that prevent `arboard` from being enabled. Launching an app on a physical device results in a long timeout (~8s) while trying to connect to the X11 server (the timeout is immediate when launching on a simulator), with the following trace: ``` egui_winit::clipboard: Failed to initialize arboard clipboard: Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable ``` <!-- 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 PR adds `Plugin::on_widget_under_pointer` which gets called whenever a widget is created whose rect contains the pointer. The point of the hook is to capture a stack trace which can be used to map widgets to their corresponding source code so it must be called while the widget is being created. The obvious concern is performance impact. However, since it's only called for rects under the cursor, the effect seems negligible afaict. It's under `debug_assertions` just in case. This change is needed so we can publish the widget inspector we've been working on. Basically a plugin that allows us to jump from any widget back to their corresponding source code. This video shows the plugin configured to open the corresponding code in github, but normally it would open your local editor. Update: [Live demo](https://membrane-io.github.io/egui/) (Firefox/Safari not yet supported. `Cmd-I` to inspect. `Tab` to cycle filters. `Click` to open). It will try to open a file under `/home/runner/work/egui/egui/` so it won't work, but you get the idea. https://github.com/user-attachments/assets/afe4d6af-7f67-44b5-be25-44f7564d9a3a ## What's next After this gets merged I plan to publish the above plugin as its own crate, that way we can iterate and release quickly while things are still changing. I agree it would make sense to eventually merge it into the main egui repo (like @emilk suggested in #4650). * [x] I have followed the instructions in the PR template --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
When dragging slider, we try to pick nice, round values. There were a couple edge cases there that were handled wrong. This is now fixed.
Useful for things like analytics
This closes a small visual glitch where scroll bars would show up when dragging something unrelated, like a slider or a panel side.
…#7708) Useful in many cases. In a follow-up PR I will use it to prevent drift when dragging/resizing windows
* Follows #7708 * Related to #202 This fixes a particular issue where resizing a window would move it, and resizing it back would not restore it. You can still move a window by resizing it (I didn't focus on that bug here), but at least now the window will return to its original position when you move back the mouse.
…7710) Sometimes when moving a window, having a tooltip attached to the mouse pointer, or scrolling a `ScrollArea`, you would see this disturbing effect:  This is caused by us rounding many visual elements (lines, rectangles, text, …) to physical pixels in order to keep them sharp. If the window/tooltip itself is not rounded to a physical pixel, then you can get this behavior. So from now on the position of all areas/windows/tooltips/popups/ScrollArea gets rounded to the closes pixel. * Unlocked by #7709
The double negative of not undefined conflicted with the example given in parens, This just removes the double negative to agree with the rest of the doc line. I have *not* audited to see if this ordering actually is strictly forced elsewhere. (Apologies for the smallest documentation pull request ever) * [x] I have followed the instructions in the PR template
|
Preview is being built... Preview will be available at https://egui-pr-preview.github.io/pr/7712-release-0.33.2 View snapshot changes at kitdiff |
c6d1090 to
4988833
Compare
This fixes calls to `ui.response().interact(Sense::click())` being flakey. Since egui checks widget interactions at the beginning of the frame, based on the responses from last frame, we need to ensure that we always call `create_widget` on `interact` calls, otherwise there can be a feedback loop where the `Sense` egui acts on flips back and forth between frames. Without the fix in `interact`, both the asserts in the new test fail. Here is a video where I experienced the bug, showing the sense switching every frame. Every other click would fail to be detected. https://github.com/user-attachments/assets/6be7ca0e-b50f-4d30-bf87-bbb80c319f3b Also note, usually it's better to use `UiBuilder::sense()` to give a Ui some sense, but sometimes you don't have the flexibility, e.g. in a `Ui` callback from some code external to your project.
4988833 to
978ec6c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
egui changelog
⭐ Added
Plugin::on_widget_under_pointerto support widget inspector #7652 by @juancampaResponse::total_drag_deltaandPointerState::total_drag_delta#7708 by @emilk🔧 Changed
ComboBox#7658 by @lucasmerlin🐛 Fixed
profiling::scopecompile error when profiling usingtracingbackend #7646 by @PPakalnsui.response().interact(Sense::click())being flakey #7713 by @lucasmerlineframe changelog
native_pixels_per_pointis set during app creation #7683 by @emilk