Browse Source

Fix cursor display

master
Garrit Franke 3 years ago
parent
commit
fb28bb1e62
  1. 5
      src/main.rs
  2. 4
      src/map.rs

5
src/main.rs

@ -156,6 +156,11 @@ impl GameState for State {
}
}
if ctx.left_click {
let mouse_pos = ctx.mouse_pos();
self.select_object(Point::from(mouse_pos));
}
// @cleanup: We shouldn't be cloning the state on each frame
self.view.render(&mut self.clone(), ctx);
}

4
src/map.rs

@ -80,10 +80,6 @@ impl Render for Chunk {
y += 1;
}
}
if ctx.left_click {
let mouse_pos = ctx.mouse_pos();
gs.select_object(Point::from(mouse_pos));
}
// Display selected object below the screen
let selected_object_text = match gs.selected_object {

Loading…
Cancel
Save