aboutsummaryrefslogtreecommitdiff
path: root/src/tool/room_tool.rs
diff options
context:
space:
mode:
authorMax Pernklau2020-11-29 21:28:39 +0100
committerGitHub2020-11-29 21:28:39 +0100
commit4f2eab931bed0ec86c6136e365ad3a1b3b8c4e87 (patch)
tree010339f867d90c2c6293ddd16c4151ec220c7b8e /src/tool/room_tool.rs
parent4d3ee44eb4892bd454a1289f7fed308f82ec6a3b (diff)
parent90db142588e1b78250dc9b266bae359cf9e22721 (diff)
downloadgraf_karto-4f2eab931bed0ec86c6136e365ad3a1b3b8c4e87.tar.gz
graf_karto-4f2eab931bed0ec86c6136e365ad3a1b3b8c4e87.zip
Merge branch 'master' into wall-join
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,