Skip to content

Commit

Permalink
Allow display limit range to be adjustable with history size
Browse files Browse the repository at this point in the history
Signed-off-by: Xiyu Oh <xiyu@openrobotics.org>
  • Loading branch information
xiyuoh committed Aug 16, 2024
1 parent 47552ea commit b0aaa8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rmf_site_editor/src/widgets/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ fn console_widget(In(input): In<PanelWidgetInput>, mut log_history: ResMut<LogHi
// TODO(@mxgrey): Consider allowing this range to
// automatically grow/shrink when the selected value
// approaches or leaves the upper limit.
let history_size = log_history.log_history().len() as f64;
let nearest_hundred: usize = 100*(history_size/100.0).ceil() as usize;
ui.add(egui::Slider::new(
log_history.display_limit_mut(),
10..=1000,
10..=nearest_hundred,
));

if !all_were_checked && all_are_checked {
Expand Down

0 comments on commit b0aaa8c

Please sign in to comment.