Skip to content

Commit

Permalink
Fix broken flamegraph interaction with egui 0.27.1 (#211)
Browse files Browse the repository at this point in the history
### Checklist

* [x] I have read the [Contributor Guide](../CONTRIBUTING.md)
* [x] I have read and agree to the [Code of
Conduct](../CODE_OF_CONDUCT.md)
* [x] I have added a description of my changes and why I'd like them
included in the section below

### Description of Changes

This PR cancels the revert (#208) of egui 0.27.1 update (#201) and fix
the flamegraph interaction bug it introduced whenever the flamegraph's
scroll area was active.

### Related Issues

* Closes #207
* Closes #205
  • Loading branch information
abey79 authored May 17, 2024
1 parent 2d7d3c6 commit b6fe0a1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 23 deletions.
42 changes: 25 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions puffin_egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
egui = { version = "0.26.1", default-features = false }
egui = { version = "0.27.1", default-features = false }
indexmap = { version = "2.1.0", features = ["serde"] }
natord = "1.0.9"
once_cell = "1.7"
Expand All @@ -36,7 +36,7 @@ vec1 = "1.8"
web-time = "0.2"

[dev-dependencies]
eframe = { version = "0.26.0", default-features = false, features = [
eframe = { version = "0.27.1", default-features = false, features = [
"default_fonts",
"glow",
] }
Expand Down
2 changes: 1 addition & 1 deletion puffin_egui/src/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ pub fn ui(
ScrollArea::vertical().show(ui, |ui| {
let mut canvas = ui.available_rect_before_wrap();
canvas.max.y = f32::INFINITY;
let response = ui.interact(canvas, ui.id(), Sense::click_and_drag());
let response = ui.interact(canvas, ui.id().with("canvas"), Sense::click_and_drag());

let (min_ns, max_ns) = if options.merge_scopes {
frames.merged_range_ns
Expand Down
4 changes: 2 additions & 2 deletions puffin_egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ impl ProfilerUi {

ui.horizontal(|ui| {
let play_pause_button_size = Vec2::splat(24.0);
let space_pressed =
ui.input(|i| i.key_pressed(egui::Key::Space)) && ui.memory(|m| m.focus().is_none());
let space_pressed = ui.input(|i| i.key_pressed(egui::Key::Space))
&& ui.memory(|m| m.focused().is_none());

if self.paused.is_some() {
if ui
Expand Down
2 changes: 1 addition & 1 deletion puffin_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ puffin = { version = "0.19.0", path = "../puffin", features = [
puffin_http = { version = "0.16.0", path = "../puffin_http" }

argh = "0.1"
eframe = { version = "0.26.0", default-features = false, features = [
eframe = { version = "0.27.1", default-features = false, features = [
"default_fonts",
"glow",
"persistence",
Expand Down

0 comments on commit b6fe0a1

Please sign in to comment.