diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index 7e04456..8ddc587 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,13 +4,15 @@ extern crate log; pub mod button; +pub mod colours; pub mod config; pub mod dimension_indicator; pub mod editor; pub mod grid; pub mod gui; -pub mod map_data; +pub mod map; pub mod math; +pub mod scaleable; pub mod svg; pub mod tool; pub mod transform; @@ -75,6 +77,8 @@ fn main() { if rl.is_mouse_button_down(MouseButton::MOUSE_MIDDLE_BUTTON) { transform.move_by_px(&(rl.get_mouse_position() - last_mouse_pos).into()); } + // Update the last mouse position + last_mouse_pos = rl.get_mouse_position(); let mouse_wheel_move = rl.get_mouse_wheel_move(); if mouse_wheel_move != 0 { @@ -87,19 +91,17 @@ fn main() { } editor.update( - &rl, + &mut rl, &transform, - ToolSidebar::mouse_captured(screen_height as u16, rl.get_mouse_position().into()), + ToolSidebar::mouse_captured(screen_height as u16, last_mouse_pos.into()), ); - // Update the last mouse position - last_mouse_pos = rl.get_mouse_position(); - // Drawing section { let mut d = rl.begin_drawing(&thread); d.clear_background(Color::BLACK); grid::draw_grid(&mut d, screen_width, screen_height, &transform); + editor.map().draw(&mut d, &transform); editor.draw_tools(&mut d, &transform); tool_sidebar.draw(screen_height as u16, &mut d, &mut editor); |
