diff options
| author | Arne Dußin | 2020-10-31 01:36:58 +0100 |
|---|---|---|
| committer | Arne Dußin | 2020-10-31 01:36:58 +0100 |
| commit | 4579d5cb376fdcc58c70d9d7ea8a5064d686ec1d (patch) | |
| tree | 98bb4b3415601348bffc1176d189264b01c1c558 /src/tool/room_tool.rs | |
| parent | c5b16dd0511997331b8cc8c3647fff95effbe8ec (diff) | |
| download | graf_karto-4579d5cb376fdcc58c70d9d7ea8a5064d686ec1d.tar.gz graf_karto-4579d5cb376fdcc58c70d9d7ea8a5064d686ec1d.zip | |
Add wall tool
The wall tool is currently just one pixels lines, which must be changed
in the future, of course, but this is also to test changing between
tools.
Diffstat (limited to 'src/tool/room_tool.rs')
| -rw-r--r-- | src/tool/room_tool.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tool/room_tool.rs b/src/tool/room_tool.rs index 6a9ad55..10b9edf 100644 --- a/src/tool/room_tool.rs +++ b/src/tool/room_tool.rs @@ -1,7 +1,7 @@ use super::Tool; use crate::math; use crate::transform::Transform; -use raylib::core::drawing::RaylibDraw; +use raylib::core::drawing::{RaylibDraw, RaylibDrawHandle}; use raylib::ffi::{Color, MouseButton}; use raylib::math::{Rectangle, Vector2}; use raylib::RaylibHandle; @@ -25,7 +25,7 @@ impl RoomTool { } impl Tool for RoomTool { - fn update(&mut self, rl: &RaylibHandle, transform: &Transform) { + fn active_update(&mut self, rl: &RaylibHandle, transform: &Transform) { let mouse_pos_m = transform.point_px_to_m(rl.get_mouse_position()); // Update the currently drawn rectangle, if it exists if let Some((_, ref mut pos2)) = &mut self.unfinished_rect { @@ -56,10 +56,7 @@ impl Tool for RoomTool { } } - fn draw<D>(&self, rld: &mut D, transform: &Transform) - where - D: RaylibDraw, - { + fn draw(&self, rld: &mut RaylibDrawHandle, transform: &Transform) { // Draw all finished rectangles. for &rect in &self.room_rects { rld.draw_rectangle_rec( |
