diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2026-08-16 10:53:45 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2026-08-16 10:53:45 -0700 |
| commit | 940e692d5b24f40147dc92c2dc23ce74c3d5ab7f (patch) | |
| tree | 8abdd835e65f46eba1235227ed1099f71849252c /src/renderer/ui.rs | |
| parent | 24886c2752548f1c32ed54968a7bfdf2b1fe38ea (diff) | |
small refactor to update loops and timing
Diffstat (limited to 'src/renderer/ui.rs')
| -rw-r--r-- | src/renderer/ui.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/renderer/ui.rs b/src/renderer/ui.rs index b4e6f74..2e4ebc4 100644 --- a/src/renderer/ui.rs +++ b/src/renderer/ui.rs @@ -15,7 +15,7 @@ pub fn draw_egui<'a>( ) { puffin::profile_function!(); ui.heading("Config"); - ui.add(egui::Slider::new(&mut config.brush_radius, 1..=100).text("Brush radius")); + ui.add(egui::Slider::new(&mut config.brush_radius, 1.0..=100.0).text("Brush radius")); let material = config.brush_material.def(); @@ -58,10 +58,10 @@ pub fn draw_egui<'a>( )) }); - if let Some((x, y)) = input.last_mouse_pos_on_board { + if let Some((x, y)) = input.last_mouse_world_pos { ui.heading("Entity"); ui.label(format!("x,y=({x}, {y})")); - if let Some(cell) = world.get_cell_from_game_position(x, y) { + if let Some(cell) = world.get_cell_from_game_position(x.round() as i32, y.round() as i32) { let material = cell.material.def(); let cell_label = ui.label( egui::RichText::new(format!("Cell: {}", material.name)).color(Color32::LIGHT_BLUE), |
