aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Dußin2020-11-15 20:02:44 +0100
committerArne Dußin2020-11-15 20:02:44 +0100
commitf36ff188caca4d4963b1be89e3f017d6a8b9dedc (patch)
tree207784651d98e4f85baaeea194324277a7354a5e
parent6aabd0123961d90095df3cefefeb0718f94aa6fc (diff)
downloadgraf_karto-f36ff188caca4d4963b1be89e3f017d6a8b9dedc.tar.gz
graf_karto-f36ff188caca4d4963b1be89e3f017d6a8b9dedc.zip
Fix deletion and wall tool ghosts
-rw-r--r--src/tool/deletion_tool.rs4
-rw-r--r--src/tool/wall_tool.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/tool/deletion_tool.rs b/src/tool/deletion_tool.rs
index 6f5ac24..bd80809 100644
--- a/src/tool/deletion_tool.rs
+++ b/src/tool/deletion_tool.rs
@@ -36,6 +36,10 @@ impl DeletionTool {
}
impl Tool for DeletionTool {
+ fn deactivate(&mut self) {
+ self.deletion_rect = None;
+ }
+
fn active_update(&mut self, map_data: &mut MapData, rl: &RaylibHandle, transform: &Transform) {
let mouse_pos_m = transform.point_px_to_m(rl.get_mouse_position().into());
if let Some((_, ref mut pos2)) = &mut self.deletion_rect {
diff --git a/src/tool/wall_tool.rs b/src/tool/wall_tool.rs
index 157f626..85079b0 100644
--- a/src/tool/wall_tool.rs
+++ b/src/tool/wall_tool.rs
@@ -24,6 +24,10 @@ impl WallTool {
}
impl Tool for WallTool {
+ fn deactivate(&mut self) {
+ self.unfinished_wall = None;
+ }
+
fn active_update(&mut self, map_data: &mut MapData, rl: &RaylibHandle, transform: &Transform) {
let mouse_pos_m = transform.point_px_to_m(rl.get_mouse_position().into());
if let Some((_, ref mut pos2)) = &mut self.unfinished_wall {