1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Improve backtraces when hovering widgets with modifiers pressed (#4696)

A useful debug-feature in egui is pressing down all modifiers keys and
hovering any widget to see its backtrace (only in `dev` builds).
Unfortunately this is incompatible with `panic="abort"`, something I
just now discovered.

So I removed `panic="abort"` from `Cargo.toml` for `dev` builds. If the
backtrace returns empty-handed, I also suggests this as a fix to the
user. Finally, I cleaned up the backtraces a bit, making them slightly
shorter and more readable.
This commit is contained in:
Emil Ernerfeldt
2024-06-23 17:03:42 +02:00
committed by GitHub
parent b1dc059ef3
commit db8db50bf3
2 changed files with 46 additions and 12 deletions

View File

@@ -43,7 +43,10 @@ panic = "abort" # This leads to better optimizations and smaller binaries (and i
# split-debuginfo = "unpacked" # faster debug builds on mac
# opt-level = 1 # Make debug builds run faster
panic = "abort" # This leads to better optimizations and smaller binaries (and is the default in Wasm anyways).
# panic = "abort" leads to better optimizations and smaller binaries (and is the default in Wasm anyways),
# but it also means backtraces don't work with the `backtrace` library (https://github.com/rust-lang/backtrace-rs/issues/397).
# egui has a feature where if you hold down all modifiers keys on your keyboard and hover any UI widget,
# you will see the backtrace to that widget, and we don't want to break that feature in dev builds.
[profile.dev.package."*"]
# Optimize all dependencies even in debug builds (does not affect workspace packages):