Skip to content

Commit 28dfcb1

Browse files
committed
Move event count logic to inside the tooltip closure where it's needed
1 parent bdb9cb4 commit 28dfcb1

File tree

1 file changed

+10
-9
lines changed
  • crates/viewer/re_time_panel/src

1 file changed

+10
-9
lines changed

crates/viewer/re_time_panel/src/lib.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -853,15 +853,6 @@ impl TimePanel {
853853
&component_name,
854854
);
855855

856-
let num_static_messages =
857-
store.num_static_events_for_component(entity_path, component_name);
858-
let num_temporal_messages = store.num_temporal_events_for_component_on_timeline(
859-
time_ctrl.timeline(),
860-
entity_path,
861-
component_name,
862-
);
863-
let total_num_messages = num_static_messages + num_temporal_messages;
864-
865856
let response = ui
866857
.list_item()
867858
.render_offscreen(false)
@@ -894,6 +885,16 @@ impl TimePanel {
894885
let response_rect = response.rect;
895886

896887
response.on_hover_ui(|ui| {
888+
let num_static_messages =
889+
store.num_static_events_for_component(entity_path, component_name);
890+
let num_temporal_messages = store
891+
.num_temporal_events_for_component_on_timeline(
892+
time_ctrl.timeline(),
893+
entity_path,
894+
component_name,
895+
);
896+
let total_num_messages = num_static_messages + num_temporal_messages;
897+
897898
if total_num_messages == 0 {
898899
ui.label(ui.ctx().warning_text(format!(
899900
"No event logged on timeline {:?}",

0 commit comments

Comments
 (0)