Skip to content

Commit

Permalink
Update egui via a [patch] (#2969)
Browse files Browse the repository at this point in the history
### What

Patch egui to `master`. This ~~brings wgpu to 0.17 and~~ addresses
emilk/egui#3176 🚀

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2969) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2969)
- [Docs
preview](https://rerun.io/preview/pr%3Aantoine%2Fegui-update/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Aantoine%2Fegui-update/examples)
  • Loading branch information
abey79 authored Aug 14, 2023
1 parent 6d23d23 commit 4c20e4b
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 136 deletions.
110 changes: 27 additions & 83 deletions Cargo.lock

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

20 changes: 15 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ clap = "4.0"
comfy-table = { version = "6.1", default-features = false }
crossbeam = "0.8"
ecolor = "0.22.0"
eframe = { version = "0.22.0", default-features = false }
eframe = { version = "0.22.0", default-features = false, features = ["x11"] }
egui = { version = "0.22.0", features = ["extra_debug_asserts", "log"] }
egui_extras = { version = "0.22.0", features = ["log"] }
egui_tiles = { version = "0.2" }
Expand All @@ -102,8 +102,8 @@ parking_lot = "0.12"
polars-core = "0.29"
polars-lazy = "0.29"
polars-ops = "0.29"
puffin = "0.15"
puffin_http = "0.12"
puffin = "0.16"
puffin_http = "0.13"
rand = { version = "0.8", default-features = false }
rand_distr = { version = "0.4", default-features = false }
rayon = "1.7"
Expand All @@ -121,7 +121,7 @@ tokio = { version = "1.24", default-features = false }
unindent = "0.1"
vec1 = "1.8"
web-time = "0.2.0"
wgpu = { version = "0.16.1" }
wgpu = { version = "0.16.3" }
wgpu-core = { version = "0.16.1" }


Expand Down Expand Up @@ -150,5 +150,15 @@ debug = true
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

# Temporary patch until next egui release
ecolor = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }
eframe = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }
egui-wgpu = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }
egui-winit = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }
egui = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }
egui_extras = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }
emath = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }
epaint = { git = "https://github.com/emilk/egui", rev = "dd417cfc1acdf7ac88f214015d4d8e7a21835d30" }

# Temporary patch until next egui_tiles release
egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", commit = "f835c4df1cc260a58122a8d37c7c3738902b9643" }
egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "f835c4df1cc260a58122a8d37c7c3738902b9643" }
2 changes: 1 addition & 1 deletion crates/re_space_view_time_series/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl SpaceViewClass for TimeSeriesSpaceView {
response,
transform,
} = plot.show(ui, |plot_ui| {
if plot_ui.plot_secondary_clicked() {
if plot_ui.response().secondary_clicked() {
let timeline = ctx.rec_cfg.time_ctrl.timeline();
ctx.rec_cfg.time_ctrl.set_timeline_and_time(
*timeline,
Expand Down
19 changes: 12 additions & 7 deletions crates/re_time_panel/src/data_density_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use std::ops::RangeInclusive;

use egui::emath::Rangef;
use egui::{epaint::Vertex, lerp, pos2, remap, Color32, NumExt as _, Rect, Shape};

use re_data_store::TimeHistogram;
Expand Down Expand Up @@ -87,9 +88,9 @@ struct DensityGraph {
}

impl DensityGraph {
pub fn new(x_range: RangeInclusive<f32>) -> Self {
let min_x = *x_range.start() - MARGIN_X;
let max_x = *x_range.end() + MARGIN_X;
pub fn new(x_range: Rangef) -> Self {
let min_x = x_range.min - MARGIN_X;
let max_x = x_range.max + MARGIN_X;
let n = ((max_x - min_x) * DENSITIES_PER_UI_PIXEL).ceil() as usize;
Self {
buckets: vec![0.0; n],
Expand Down Expand Up @@ -187,15 +188,19 @@ impl DensityGraph {

pub fn paint(
&self,
data_dentity_graph_painter: &mut DataDensityGraphPainter,
y_range: RangeInclusive<f32>,
data_density_graph_painter: &mut DataDensityGraphPainter,
y_range: Rangef,
painter: &egui::Painter,
full_color: Color32,
hovered_x_range: RangeInclusive<f32>,
) {
re_tracing::profile_function!();

let (min_y, max_y) = (*y_range.start(), *y_range.end());
let Rangef {
min: min_y,
max: max_y,
} = y_range;

let center_y = (min_y + max_y) / 2.0;
let max_radius = (max_y - min_y) / 2.0;

Expand Down Expand Up @@ -235,7 +240,7 @@ impl DensityGraph {

let x = self.x_from_bucket_index(i);

let normalized_density = data_dentity_graph_painter.normalize_density(density);
let normalized_density = data_density_graph_painter.normalize_density(density);

let (inner_radius, inner_color) = if normalized_density == 0.0 {
(0.0, Color32::TRANSPARENT)
Expand Down
Loading

0 comments on commit 4c20e4b

Please sign in to comment.