aboutsummaryrefslogtreecommitdiff
path: root/src/tool/deletion_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/deletion_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/deletion_tool.rs')
-rw-r--r--src/tool/deletion_tool.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tool/deletion_tool.rs b/src/tool/deletion_tool.rs
index 17dd949..74a8f92 100644
--- a/src/tool/deletion_tool.rs
+++ b/src/tool/deletion_tool.rs
@@ -10,7 +10,7 @@ use raylib::RaylibHandle;
pub struct DeletionTool {
keybindings: DeletionToolKeybindings,
- deletion_rect: Option<(Vec2<f32>, Vec2<f32>)>,
+ deletion_rect: Option<(Vec2<f64>, Vec2<f64>)>,
}
impl DeletionTool {
@@ -22,7 +22,7 @@ impl DeletionTool {
}
/// Delete all map-data that is contained inside the provided rectangular space.
- pub fn delete_rect(map_data: &mut MapData, rect: Rect<f32>) {
+ pub fn delete_rect(map_data: &mut MapData, rect: Rect<f64>) {
map_data
.rooms_mut()
.retain(|&room| !rect.contains_rect(&room));
@@ -50,7 +50,7 @@ impl Tool for DeletionTool {
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.deletion_rect {
*pos2 = mouse_pos_m;
}
@@ -72,7 +72,7 @@ impl Tool for DeletionTool {
fn draw(&self, _map_data: &MapData, rld: &mut RaylibDrawHandle, transform: &Transform) {
if let Some((pos1, pos2)) = self.deletion_rect {
- let rect_px = transform.rect_m_to_px(Rect::bounding_rect(pos1, pos2));
+ let rect_px = transform.rect_m_to_px(&Rect::bounding_rect(pos1, pos2));
rld.draw_rectangle_rec(
rect_px,
Color {