aboutsummaryrefslogtreecommitdiff
path: root/src/tool/room_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/room_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/room_tool.rs')
-rw-r--r--src/tool/room_tool.rs8
1 files changed, 4 insertions, 4 deletions
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<f32>, Vec2<f32>)>,
+ unfinished_rect: Option<(Vec2<f64>, Vec2<f64>)>,
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,