aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 8c1d63e..38f3912 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -29,6 +29,7 @@ pub mod grid;
pub mod gui;
pub mod map;
pub mod math;
+pub mod snapping;
pub mod svg;
pub mod tool;
pub mod transform;
@@ -38,6 +39,7 @@ use config::Config;
use editor::Editor;
use gui::{DimensionIndicator, ToolSidebar};
use raylib::prelude::*;
+use snapping::Snapper;
use std::ffi::CString;
use std::io;
use transform::Transform;
@@ -86,6 +88,7 @@ fn main() {
let mut editor = Editor::new(&mut rl, &thread, config);
let mut dimension_indicator = DimensionIndicator::new();
let tool_sidebar = ToolSidebar::new(&mut rl, &thread);
+ let mut snapper = Snapper::default();
let mut transform = Transform::new();
let mut last_mouse_pos = rl.get_mouse_position();
@@ -111,10 +114,12 @@ fn main() {
}
dimension_indicator.update(editor.map_mut(), &mut rl);
+ snapper.update(&mut rl);
editor.update(
&mut rl,
&transform,
+ &snapper,
ToolSidebar::mouse_captured(screen_height as u16, last_mouse_pos.into()),
);
@@ -127,6 +132,7 @@ fn main() {
editor.draw_tools(&mut d, &transform);
tool_sidebar.draw(screen_height as u16, &mut d, &mut editor);
+ snapper.draw(&mut d);
dimension_indicator.draw(&mut d, &transform);
}