aboutsummaryrefslogtreecommitdiff
path: root/src/tool/wall_tool.rs
diff options
context:
space:
mode:
authorArne Dußin2020-11-27 22:55:00 +0100
committerArne Dußin2020-11-27 22:55:00 +0100
commit4c4b57dc24bc36b3091931c9dcc36f6b1894a017 (patch)
tree83f835eb850f249eff2e7694707464c9d4713a69 /src/tool/wall_tool.rs
parent99e935b63bb023cfd46c8f3d81074d3faf7ce592 (diff)
downloadgraf_karto-4c4b57dc24bc36b3091931c9dcc36f6b1894a017.tar.gz
graf_karto-4c4b57dc24bc36b3091931c9dcc36f6b1894a017.zip
Change to f64 as the preferred floating point number
Diffstat (limited to 'src/tool/wall_tool.rs')
-rw-r--r--src/tool/wall_tool.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tool/wall_tool.rs b/src/tool/wall_tool.rs
index 2cc5b5d..e6503ba 100644
--- a/src/tool/wall_tool.rs
+++ b/src/tool/wall_tool.rs
@@ -11,7 +11,7 @@ use raylib::RaylibHandle;
pub struct WallTool {
keybindings: WallToolKeybindings,
- unfinished_wall: Option<(Vec2<f32>, Vec2<f32>)>,
+ unfinished_wall: Option<(Vec2<f64>, Vec2<f64>)>,
}
impl WallTool {
@@ -35,7 +35,7 @@ impl Tool for WallTool {
transform: &Transform,
mouse_blocked: bool,
) {
- let mouse_pos_m = transform.point_px_to_m(rl.get_mouse_position().into());
+ let mouse_pos_m = transform.point_px_to_m(&rl.get_mouse_position().into());
if let Some((_, ref mut pos2)) = &mut self.unfinished_wall {
*pos2 = snap_to_grid(mouse_pos_m, SNAP_SIZE);
}
@@ -61,12 +61,12 @@ impl Tool for WallTool {
fn draw(&self, map_data: &MapData, rld: &mut RaylibDrawHandle, transform: &Transform) {
for &(pos1, pos2) in map_data.walls() {
- let pos1: Vector2 = transform.point_m_to_px(pos1).into();
- let pos2: Vector2 = transform.point_m_to_px(pos2).into();
+ let pos1: Vector2 = transform.point_m_to_px(&pos1).into();
+ let pos2: Vector2 = transform.point_m_to_px(&pos2).into();
rld.draw_line_ex(
pos1,
pos2,
- transform.length_m_to_px(0.1),
+ transform.length_m_to_px(0.1) as f32,
Color {
r: 200,
g: 120,
@@ -77,12 +77,12 @@ impl Tool for WallTool {
}
if let Some((pos1, pos2)) = self.unfinished_wall {
- let pos1: Vector2 = transform.point_m_to_px(pos1).into();
- let pos2: Vector2 = transform.point_m_to_px(pos2).into();
+ let pos1: Vector2 = transform.point_m_to_px(&pos1).into();
+ let pos2: Vector2 = transform.point_m_to_px(&pos2).into();
rld.draw_line_ex(
pos1,
pos2,
- transform.length_m_to_px(0.1),
+ transform.length_m_to_px(0.1) as f32,
Color {
r: 150,
g: 200,