summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/ui.rs6
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),