aboutsummaryrefslogtreecommitdiff
path: root/src/guide.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/guide.rs
parent62d9de6a368a50dcb62b2b97a5fb02a3858b0977 (diff)
basic support for adding guides
Diffstat (limited to 'src/guide.rs')
-rw-r--r--src/guide.rs22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/guide.rs b/src/guide.rs
index 006566e..85d0594 100644
--- a/src/guide.rs
+++ b/src/guide.rs
@@ -1,7 +1,21 @@
1use crate::bitmap::Axis; 1use crate::{
2 bitmap::Axis,
3 lisp::{expr::LispExpr, number::LispNumber},
4};
2 5
3#[derive(Debug)] 6use std::convert::Into;
7
8#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)]
4pub struct Guide { 9pub struct Guide {
5 axis: Axis, 10 pub axis: Axis,
6 offset: u32, 11 pub offset: u32,
12}
13
14impl Into<LispExpr> for Guide {
15 fn into(self) -> LispExpr {
16 LispExpr::List(vec![
17 self.axis.into(),
18 LispExpr::Number(LispNumber::Integer(self.offset as i64)),
19 ])
20 }
7} 21}