aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorArne Dußin2021-01-06 22:56:37 +0100
committerArne Dußin2021-01-06 22:56:37 +0100
commitfa1afb6be3ba2d521eb0791edc0bb8e631a85327 (patch)
treee0a365444784efaaeb1eea6373b34559b6d57fbc /src/main.rs
parent1c81d7c70fe891e6ded49d49d6a09f04ce74dd6e (diff)
parent30b23db9e86fdf72a4e7de72213df274ce19123e (diff)
downloadgraf_karto-fa1afb6be3ba2d521eb0791edc0bb8e631a85327.tar.gz
graf_karto-fa1afb6be3ba2d521eb0791edc0bb8e631a85327.zip
Merge branch 'master' into snapping
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 345477b..105bb44 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -22,6 +22,7 @@
extern crate log;
pub mod button;
+pub mod cli;
pub mod colours;
pub mod config;
pub mod editor;
@@ -35,8 +36,10 @@ pub mod tool;
pub mod transform;
pub mod transformable;
+use cli::CLI;
use config::Config;
use editor::Editor;
+use float_cmp::F64Margin;
use gui::{DimensionIndicator, ToolSidebar};
use raylib::prelude::*;
use snapping::Snapper;
@@ -49,6 +52,14 @@ pub const GUI_STYLE: &str = "assets/style/cyber.rgs";
/// Location of the graf karto configuration options file.
pub const CONFIG_FILE: &str = "config.ron";
+/// The acceptable error that is used throughout the project for two floats to be considered equal.
+/// If it is set too low, the editor might not work properly, if set too high, the granularity may
+/// become too low for certain purposes.
+pub const FLOAT_MARGIN: F64Margin = F64Margin {
+ epsilon: 10000. * f64::EPSILON,
+ ulps: 0,
+};
+
fn main() {
pretty_env_logger::init();
@@ -89,6 +100,7 @@ fn main() {
let mut dimension_indicator = DimensionIndicator::new();
let tool_sidebar = ToolSidebar::new(&mut rl, &thread);
let mut snapper = Snapper::default();
+ let mut cli = CLI::new();
let mut transform = Transform::new();
let mut last_mouse_pos = rl.get_mouse_position();
@@ -113,9 +125,9 @@ fn main() {
);
}
+ cli.update(&mut rl, &mut editor);
dimension_indicator.update(editor.map_mut(), &mut rl);
snapper.update(&mut rl);
-
editor.update(
&mut rl,
&transform,
@@ -133,9 +145,9 @@ fn main() {
editor.draw_tools(&mut d, &transform);
tool_sidebar.draw(screen_height as u16, &mut d, &mut editor);
snapper.draw(&mut d);
-
gui::position_indicator_draw(&mut d, last_mouse_pos.into(), &transform, &snapper);
dimension_indicator.draw(&mut d, &transform);
+ cli.draw(&mut d);
}
}
}