Skip to content
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

Update egui via a [patch] #2969

Merged
merged 7 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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