Skip to content

Commit

Permalink
Option to turn off grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterchef365 committed Jun 10, 2024
1 parent 0abeac0 commit 9e4b2af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub struct DemoApp {
cfg: SolverConfig,

grid: Vec<(Vec3, Vec3)>,

draw_grid: bool,
}

impl Default for DemoApp {
Expand Down Expand Up @@ -47,6 +49,7 @@ impl DemoApp {
let cfg = Default::default();

Self {
draw_grid: true,
cfg,
pcld,
grid,
Expand Down Expand Up @@ -109,6 +112,8 @@ impl eframe::App for DemoApp {
let resp_width = ui.add(DragValue::new(&mut width).prefix("width: ").clamp_range(2..=100));
let regen = ui.button("Refresh").clicked();

ui.checkbox(&mut self.draw_grid, "Draw grid");

if resp_dims.changed() || resp_width.changed() || regen {
*self = Self::from_dims(dims, width);
}
Expand Down Expand Up @@ -136,7 +141,9 @@ impl eframe::App for DemoApp {
}
*/

draw_n_grid(&self.grid, paint, Stroke::new(1., Color32::from_gray(40)));
if self.draw_grid {
draw_n_grid(&self.grid, paint, Stroke::new(1., Color32::from_gray(40)));
}

draw_pcld(&self.pcld, &self.proj, paint, 1., Color32::WHITE);
})
Expand Down

0 comments on commit 9e4b2af

Please sign in to comment.