diff --git a/Cargo.lock b/Cargo.lock index 68944fa4819d..5c60e73afbee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1957,7 +1957,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecolor" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "bytemuck", "color-hex", @@ -1974,7 +1974,7 @@ checksum = "18aade80d5e09429040243ce1143ddc08a92d7a22820ac512610410a4dd5214f" [[package]] name = "eframe" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "ahash", "bytemuck", @@ -2013,7 +2013,7 @@ dependencies = [ [[package]] name = "egui" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "accesskit", "ahash", @@ -2031,7 +2031,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "ahash", "bytemuck", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "accesskit_winit", "ahash", @@ -2070,7 +2070,7 @@ dependencies = [ [[package]] name = "egui_commonmark" version = "0.19.0" -source = "git+https://github.com/rerun-io/egui_commonmark.git?branch=egui-update#d08ab5704b9cf6bd4234757c43b49e86c7f053c4" +source = "git+https://github.com/rerun-io/egui_commonmark.git?branch=egui-update#9d500ac65fea8273f8d26eb6f513dded86778389" dependencies = [ "egui", "egui_commonmark_backend", @@ -2081,7 +2081,7 @@ dependencies = [ [[package]] name = "egui_commonmark_backend" version = "0.19.0" -source = "git+https://github.com/rerun-io/egui_commonmark.git?branch=egui-update#d08ab5704b9cf6bd4234757c43b49e86c7f053c4" +source = "git+https://github.com/rerun-io/egui_commonmark.git?branch=egui-update#9d500ac65fea8273f8d26eb6f513dded86778389" dependencies = [ "egui", "egui_extras", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "ahash", "egui", @@ -2108,7 +2108,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "ahash", "bytemuck", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "dify", "eframe", @@ -2140,7 +2140,7 @@ dependencies = [ [[package]] name = "egui_plot" version = "0.30.0" -source = "git+https://github.com/emilk/egui_plot.git?rev=80e2199a2e121db288fe6b0099d91c35acc75a7c#80e2199a2e121db288fe6b0099d91c35acc75a7c" +source = "git+https://github.com/emilk/egui_plot.git?branch=main#a19562ea60a13b276a1e96035c5600fb4932ce53" dependencies = [ "ahash", "egui", @@ -2161,8 +2161,7 @@ dependencies = [ [[package]] name = "egui_tiles" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "588dcf9028464fb4d23baf1f7805c13927fb540f2f9096f7d177b814848645a3" +source = "git+https://github.com/rerun-io/egui_tiles?branch=emilk/update-egui#4876446fd618c59571490c7a637043d569f2e531" dependencies = [ "ahash", "egui", @@ -2196,7 +2195,7 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "emath" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "bytemuck", "serde", @@ -2312,7 +2311,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" dependencies = [ "ab_glyph", "ahash", @@ -2331,7 +2330,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?branch=master#83649f2e295a4c27ea08023b6e7f591d3e60ea7f" +source = "git+https://github.com/emilk/egui.git?branch=master#8eda32ec64c7b48c7b8f9195e3abc8c10efa8f00" [[package]] name = "equivalent" diff --git a/Cargo.toml b/Cargo.toml index 78489b7c0eb5..105198ef2aea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -590,10 +590,10 @@ emath = { git = "https://github.com/emilk/egui.git", branch = "master" } # egui-wgpu = { path = "../../egui/crates/egui-wgpu" } # emath = { path = "../../egui/crates/emath" } -egui_plot = { git = "https://github.com/emilk/egui_plot.git", rev = "80e2199a2e121db288fe6b0099d91c35acc75a7c" } +egui_plot = { git = "https://github.com/emilk/egui_plot.git", branch = "main" } # egui_plot = { path = "../../egui_plot/egui_plot" } -# egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "48e0ef566479000a23d8dabf84badced98f1b9a6" } # https://github.com/rerun-io/egui_tiles/pull/89 2024-11-19 +egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", branch = "emilk/update-egui" } #egui_tiles = { path = "../egui_tiles" } egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark.git", branch = "egui-update" } # https://github.com/lampsitter/egui_commonmark/pull/71 diff --git a/crates/viewer/re_component_ui/src/color.rs b/crates/viewer/re_component_ui/src/color.rs index 48392540adf1..1c20019690fb 100644 --- a/crates/viewer/re_component_ui/src/color.rs +++ b/crates/viewer/re_component_ui/src/color.rs @@ -35,6 +35,7 @@ fn edit_rgba32_impl(ui: &mut egui::Ui, color: &mut MaybeMutRef<'_, Rgba32>) -> e response.rect, 1.0, ui.visuals().widgets.noninteractive.fg_stroke, + egui::StrokeKind::Inside, ); let [r, g, b, a] = color.to_array(); diff --git a/crates/viewer/re_component_ui/src/marker_shape.rs b/crates/viewer/re_component_ui/src/marker_shape.rs index 955f0ff2fe4e..5afe9f24cb4d 100644 --- a/crates/viewer/re_component_ui/src/marker_shape.rs +++ b/crates/viewer/re_component_ui/src/marker_shape.rs @@ -81,7 +81,7 @@ pub(crate) fn paint_marker( .filled(true); let bounds = egui_plot::PlotBounds::new_symmetrical(0.5); - let transform = egui_plot::PlotTransform::new(rect, bounds, [true, true].into()); + let transform = egui_plot::PlotTransform::new(rect, bounds, true); let mut shapes = vec![]; points.shapes(ui, &transform, &mut shapes); diff --git a/crates/viewer/re_time_panel/src/lib.rs b/crates/viewer/re_time_panel/src/lib.rs index 69a110f676ad..9a16f5edc220 100644 --- a/crates/viewer/re_time_panel/src/lib.rs +++ b/crates/viewer/re_time_panel/src/lib.rs @@ -1235,11 +1235,10 @@ fn paint_range_highlight( let visible_history_area_rect = Rect::from_x_y_ranges(x_from..=x_to, rect.y_range()).intersect(rect); - painter.rect( + painter.rect_filled( visible_history_area_rect, 0.0, egui::Color32::WHITE.gamma_multiply(0.1), - egui::Stroke::NONE, ); } } diff --git a/crates/viewer/re_ui/src/list_item/list_item.rs b/crates/viewer/re_ui/src/list_item/list_item.rs index 051c7c33cbe2..4b1ccf2a531b 100644 --- a/crates/viewer/re_ui/src/list_item/list_item.rs +++ b/crates/viewer/re_ui/src/list_item/list_item.rs @@ -412,7 +412,12 @@ impl ListItem { let stroke = crate::design_tokens().drop_target_container_stroke(); ui.painter().set( background_frame, - Shape::rect_stroke(bg_rect_to_paint.shrink(stroke.width), 0.0, stroke), + Shape::rect_stroke( + bg_rect_to_paint.shrink(stroke.width), + 0.0, + stroke, + egui::StrokeKind::Inside, + ), ); } diff --git a/crates/viewer/re_ui/src/ui_ext.rs b/crates/viewer/re_ui/src/ui_ext.rs index 1a645758ab38..bebd9bb64764 100644 --- a/crates/viewer/re_ui/src/ui_ext.rs +++ b/crates/viewer/re_ui/src/ui_ext.rs @@ -769,6 +769,7 @@ pub trait UiExt { visuals.rounding, visuals.weak_bg_fill, visuals.bg_stroke, + egui::StrokeKind::Inside, ); } diff --git a/crates/viewer/re_view_graph/src/ui/draw.rs b/crates/viewer/re_view_graph/src/ui/draw.rs index c6f2940a363d..89f175157650 100644 --- a/crates/viewer/re_view_graph/src/ui/draw.rs +++ b/crates/viewer/re_view_graph/src/ui/draw.rs @@ -305,8 +305,13 @@ pub fn draw_entity_rect( let padded = rect.expand(10.0); - ui.painter() - .rect(padded, 0.0, Color32::TRANSPARENT, Stroke::new(1.0, color)); + ui.painter().rect( + padded, + 0.0, + Color32::TRANSPARENT, + Stroke::new(1.0, color), + egui::StrokeKind::Inside, + ); ui.painter().text( padded.left_top(), diff --git a/crates/viewer/re_view_spatial/src/picking_ui_pixel.rs b/crates/viewer/re_view_spatial/src/picking_ui_pixel.rs index 033d7d654509..04544b272915 100644 --- a/crates/viewer/re_view_spatial/src/picking_ui_pixel.rs +++ b/crates/viewer/re_view_spatial/src/picking_ui_pixel.rs @@ -125,8 +125,18 @@ fn show_zoomed_image_region_area_outline( let sample_rect = Rect::from_min_max(pos2(left, top), pos2(right, bottom)); // TODO(emilk): use `parent_ui.painter()` and put it in a high Z layer, when https://github.com/emilk/egui/issues/1516 is done let painter = egui_ctx.debug_painter().with_clip_rect(ui_clip_rect); - painter.rect_stroke(sample_rect, 0.0, (2.0, egui::Color32::BLACK)); - painter.rect_stroke(sample_rect, 0.0, (1.0, egui::Color32::WHITE)); + painter.rect_stroke( + sample_rect, + 0.0, + (2.0, egui::Color32::BLACK), + egui::StrokeKind::Middle, + ); + painter.rect_stroke( + sample_rect, + 0.0, + (1.0, egui::Color32::WHITE), + egui::StrokeKind::Middle, + ); } /// Identifies an image/texture interaction. @@ -230,8 +240,14 @@ fn try_show_zoomed_image_region( center_texel_rect.expand(1.0), 0.0, (1.0, egui::Color32::BLACK), + egui::StrokeKind::Outside, + ); + painter.rect_stroke( + center_texel_rect, + 0.0, + (1.0, egui::Color32::WHITE), + egui::StrokeKind::Outside, ); - painter.rect_stroke(center_texel_rect, 0.0, (1.0, egui::Color32::WHITE)); } let [x, y] = center_texel; diff --git a/crates/viewer/re_view_spatial/src/ui.rs b/crates/viewer/re_view_spatial/src/ui.rs index bf282ef7322b..5a3bc3e81964 100644 --- a/crates/viewer/re_view_spatial/src/ui.rs +++ b/crates/viewer/re_view_spatial/src/ui.rs @@ -269,8 +269,14 @@ pub fn create_labels( }; label_shapes.push( - egui::epaint::RectShape::new(bg_rect.expand(4.0), 4.0, background_color, rect_stroke) - .into(), + egui::epaint::RectShape::new( + bg_rect.expand(4.0), + 4.0, + background_color, + rect_stroke, + egui::StrokeKind::Outside, + ) + .into(), ); label_shapes.push(egui::Shape::galley( text_rect.center_top(), diff --git a/crates/viewer/re_view_time_series/src/view_class.rs b/crates/viewer/re_view_time_series/src/view_class.rs index 0809a12f18e9..9b3b5d6bf2c2 100644 --- a/crates/viewer/re_view_time_series/src/view_class.rs +++ b/crates/viewer/re_view_time_series/src/view_class.rs @@ -369,7 +369,7 @@ Display time series data in a plot. let time_zone_for_timestamps = ctx.app_options.time_zone; let mut plot = Plot::new(plot_id_src) .id(crate::plot_id(query.view_id)) - .auto_bounds([true, false].into()) // Never use y auto bounds: we dictated bounds via blueprint under all circumstances. + .auto_bounds([true, false]) // Never use y auto bounds: we dictated bounds via blueprint under all circumstances. .allow_zoom([true, !lock_y_during_zoom]) .x_axis_formatter(move |time, _| { format_time( @@ -436,13 +436,10 @@ Display time series data in a plot. )); let current_auto = plot_ui.auto_bounds(); - plot_ui.set_auto_bounds( - [ - current_auto[0] || is_resetting, - is_resetting && !y_zoom_lock, - ] - .into(), - ); + plot_ui.set_auto_bounds([ + current_auto[0] || is_resetting, + is_resetting && !y_zoom_lock, + ]); *state.scalar_range.start_mut() = f64::INFINITY; *state.scalar_range.end_mut() = f64::NEG_INFINITY; diff --git a/crates/viewer/re_viewer/src/app.rs b/crates/viewer/re_viewer/src/app.rs index e8b8013ae8f8..34f36d519752 100644 --- a/crates/viewer/re_viewer/src/app.rs +++ b/crates/viewer/re_viewer/src/app.rs @@ -2070,9 +2070,10 @@ fn paint_native_window_frame(egui_ctx: &egui::Context) { ); painter.rect_stroke( - egui_ctx.screen_rect().shrink(0.5), + egui_ctx.screen_rect(), re_ui::DesignTokens::native_window_rounding(), re_ui::design_tokens().native_frame_stroke, + egui::StrokeKind::Inside, ); } diff --git a/crates/viewer/re_viewport/src/viewport_ui.rs b/crates/viewer/re_viewport/src/viewport_ui.rs index 13294947ff33..969def3bafde 100644 --- a/crates/viewer/re_viewport/src/viewport_ui.rs +++ b/crates/viewer/re_viewport/src/viewport_ui.rs @@ -166,10 +166,9 @@ impl ViewportUi { egui::LayerId::new(ui.layer_id().order, ui.id().with("child_id")); ui.ctx().set_sublayer(ui.layer_id(), top_layer_id); // Make sure it is directly on top of the ui layer - // We need to shrink a bit so the panel-resize lines don't cover the highlight rectangle. - // This is hacky. + // We paint the stroke on the inside so the panel-resize lines don't cover the highlight rectangle. let painter = ui.painter().clone().with_layer_id(top_layer_id); - painter.rect_stroke(rect.shrink(stroke.width), 0.0, stroke); + painter.rect_stroke(rect, 0.0, stroke, egui::StrokeKind::Inside); if should_display_drop_destination_frame { painter.rect_filled( @@ -820,8 +819,7 @@ impl TabWidget { } fn paint(self, ui: &egui::Ui) { - ui.painter() - .rect(self.rect, 0.0, self.bg_color, egui::Stroke::NONE); + ui.painter().rect_filled(self.rect, 0.0, self.bg_color); let icon_image = self .icon