aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-04-04 11:09:17 +0100
committerAkshay <[email protected]>2021-04-04 14:07:09 +0100
commitc4354e2d8d51cc9fc12dce9ad2d5736e400a8de4 (patch)
treea651a7d2406886869be693baa7afbd7807fdfa0f /src/app.rs
parent62d9de6a368a50dcb62b2b97a5fb02a3858b0977 (diff)
basic support for adding guides
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/app.rs b/src/app.rs
index 4a4e2cc..243b196 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -1,22 +1,24 @@
1use crate::{ 1use crate::{
2 bitmap::{positive_angle_with_x, MapPoint, Pixmap}, 2 bitmap::{positive_angle_with_x, Axis, MapPoint, Pixmap},
3 brush::{Brush, CircleBrush, LineBrush}, 3 brush::{Brush, CircleBrush, LineBrush},
4 cache::Cache, 4 cache::Cache,
5 command::CommandBox, 5 command::CommandBox,
6 consts::{colors::*, FONT_PATH, RC_PATH, STDLIB_PATH}, 6 consts::{colors::*, FONT_PATH, RC_PATH, STDLIB_PATH},
7 dither, 7 dither,
8 error::AppError, 8 error::AppError,
9 guide::Guide,
9 lisp::{eval, lex::Lexer, parse::Parser, prelude, EnvList}, 10 lisp::{eval, lex::Lexer, parse::Parser, prelude, EnvList},
10 message::Message, 11 message::Message,
11 rect, 12 rect,
12 symmetry::Symmetry, 13 symmetry::Symmetry,
13 undo::{ModifyRecord, OpKind, PaintRecord, UndoStack}, 14 undo::{ModifyRecord, OpKind, PaintRecord, UndoStack},
14 utils::{draw_text, handle_error, is_copy_event, is_paste_event, load_script}, 15 utils::{self, draw_text, handle_error, is_copy_event, is_paste_event, load_script},
15 widget::{Container, HorAlign, Offset, Size, VertAlign}, 16 widget::{Container, HorAlign, Offset, Size, VertAlign},
16}; 17};
17 18
18use std::{ 19use std::{
19 cell::RefCell, 20 cell::RefCell,
21 collections::HashMap,
20 convert::From, 22 convert::From,
21 fs::File, 23 fs::File,
22 io::prelude::*, 24 io::prelude::*,
@@ -52,6 +54,7 @@ pub struct AppState<'ctx> {
52 pub current_operation: Vec<PaintRecord>, 54 pub current_operation: Vec<PaintRecord>,
53 pub dither_level: u8, 55 pub dither_level: u8,
54 pub file_name: Option<PathBuf>, 56 pub file_name: Option<PathBuf>,
57 pub guides: HashMap<Guide, bool>,
55 pub grid: Grid, 58 pub grid: Grid,
56 pub lisp_env: EnvList, 59 pub lisp_env: EnvList,
57 pub message: Message, 60 pub message: Message,
@@ -604,6 +607,7 @@ impl<'ctx> AppState<'ctx> {
604 command_box: CommandBox::new(), 607 command_box: CommandBox::new(),
605 context, 608 context,
606 cache: RefCell::new(None), 609 cache: RefCell::new(None),
610 guides: HashMap::new(),
607 current_operation: Vec::new(), 611 current_operation: Vec::new(),
608 dither_level: 16, 612 dither_level: 16,
609 file_name, 613 file_name,