From 4c4b57dc24bc36b3091931c9dcc36f6b1894a017 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Fri, 27 Nov 2020 22:55:00 +0100 Subject: Change to f64 as the preferred floating point number --- src/tool/room_tool.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tool/room_tool.rs') diff --git a/src/tool/room_tool.rs b/src/tool/room_tool.rs index c4a8b8c..6a283e3 100644 --- a/src/tool/room_tool.rs +++ b/src/tool/room_tool.rs @@ -14,7 +14,7 @@ pub struct RoomTool { keybindings: RoomToolKeybindings, /// The rectangle that is currently being drawn by the user. Once it is finished, it will be /// pushed into the room_rects. - unfinished_rect: Option<(Vec2, Vec2)>, + unfinished_rect: Option<(Vec2, Vec2)>, dimension_indicator: DimensionIndicator, } @@ -42,7 +42,7 @@ impl Tool for RoomTool { 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()); // Update the currently drawn rectangle, if it exists, and also its dimension indicator. if let Some((ref pos1, ref mut pos2)) = &mut self.unfinished_rect { *pos2 = snap_to_grid(mouse_pos_m, SNAP_SIZE); @@ -71,7 +71,7 @@ impl Tool for RoomTool { // Draw all finished rectangles. for &rect in map_data.rooms() { rld.draw_rectangle_rec( - transform.rect_m_to_px(rect), + transform.rect_m_to_px(&rect), Color { r: 180, g: 180, @@ -84,7 +84,7 @@ impl Tool for RoomTool { // Do the same for the unfinished rectangle if let Some((pos1, pos2)) = self.unfinished_rect { rld.draw_rectangle_rec( - transform.rect_m_to_px(Rect::bounding_rect(pos1, pos2)), + transform.rect_m_to_px(&Rect::bounding_rect(pos1, pos2)), Color { r: 150, g: 200, -- cgit v1.2.3-70-g09d2