From 4579d5cb376fdcc58c70d9d7ea8a5064d686ec1d Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Sat, 31 Oct 2020 01:36:58 +0100 Subject: 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. --- src/tool/room_tool.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/tool/room_tool.rs') 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(&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( -- cgit v1.2.3-70-g09d2