diff options
| author | Max Pernklau | 2020-11-29 21:28:39 +0100 |
|---|---|---|
| committer | GitHub | 2020-11-29 21:28:39 +0100 |
| commit | 4f2eab931bed0ec86c6136e365ad3a1b3b8c4e87 (patch) | |
| tree | 010339f867d90c2c6293ddd16c4151ec220c7b8e /src/tool/wall_tool.rs | |
| parent | 4d3ee44eb4892bd454a1289f7fed308f82ec6a3b (diff) | |
| parent | 90db142588e1b78250dc9b266bae359cf9e22721 (diff) | |
| download | graf_karto-4f2eab931bed0ec86c6136e365ad3a1b3b8c4e87.tar.gz graf_karto-4f2eab931bed0ec86c6136e365ad3a1b3b8c4e87.zip | |
Merge branch 'master' into wall-join
Diffstat (limited to 'src/tool/wall_tool.rs')
| -rw-r--r-- | src/tool/wall_tool.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tool/wall_tool.rs b/src/tool/wall_tool.rs index 715a8b9..35b2458 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); } @@ -103,12 +103,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, |
