diff options
| author | Arne Dußin | 2020-11-20 20:00:28 +0100 |
|---|---|---|
| committer | Arne Dußin | 2020-11-20 20:00:28 +0100 |
| commit | cf0cbe3fd28b2099b580edc1714b4d68bf7183cd (patch) | |
| tree | b03561c1ae7860cad247d089cb1ad728efa843ec /src/main.rs | |
| parent | f62dabcb390d4808739745c050dfba8e2826b214 (diff) | |
| download | graf_karto-cf0cbe3fd28b2099b580edc1714b4d68bf7183cd.tar.gz graf_karto-cf0cbe3fd28b2099b580edc1714b4d68bf7183cd.zip | |
Add simple tool sidebar gui
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 8e3bf51..1ebcbfe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ pub mod config; pub mod dimension_indicator; pub mod editor; pub mod grid; +pub mod gui; pub mod map_data; pub mod math; pub mod svg; @@ -16,6 +17,7 @@ pub mod transform; use config::Config; use editor::Editor; +use gui::ToolSidebar; use raylib::prelude::*; use std::io; use transform::Transform; @@ -52,6 +54,7 @@ fn main() { }; let mut editor = Editor::new(&mut rl, &thread, config); + let tool_sidebar = ToolSidebar::new(&mut rl, &thread); let mut transform = Transform::new(); let mut last_mouse_pos = rl.get_mouse_position(); @@ -74,7 +77,11 @@ fn main() { ); } - editor.update(&rl, &transform); + editor.update( + &rl, + &transform, + ToolSidebar::mouse_captured(screen_height as u16, rl.get_mouse_position().into()), + ); // Update the last mouse position last_mouse_pos = rl.get_mouse_position(); @@ -86,6 +93,7 @@ fn main() { grid::draw_grid(&mut d, screen_width, screen_height, &transform); editor.draw_tools(&mut d, &transform); + tool_sidebar.draw(screen_height as u16, &mut d, &mut editor); } } } |
