summaryrefslogtreecommitdiffstats
path: root/src/coordinates.rs
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-01-30 15:26:24 +0100
committerrabite <rabite@posteo.de>2019-01-30 15:26:24 +0100
commit60468a4c660288b663506a404c922b2506fc6542 (patch)
tree24ed29962e3ca98e5430095f8a050c16978fd3fa /src/coordinates.rs
parentb96895a2f28e1e9fead9228617cdc02fdd1f3c31 (diff)
previewing text files
Diffstat (limited to 'src/coordinates.rs')
-rw-r--r--src/coordinates.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/coordinates.rs b/src/coordinates.rs
index 5506b4d..6283cdf 100644
--- a/src/coordinates.rs
+++ b/src/coordinates.rs
@@ -1,16 +1,19 @@
-#[derive(Debug,Clone)]
+#[derive(Debug,Clone,PartialEq)]
pub struct Size(pub (u16,u16));
-#[derive(Debug,Clone)]
+#[derive(Debug,Clone,PartialEq)]
pub struct Position(pub (u16,u16));
-#[derive(Debug,Clone)]
+#[derive(Debug,Clone,PartialEq)]
pub struct Coordinates {
pub size: Size,
pub position: Position,
}
impl Coordinates {
+ pub fn new() -> Coordinates {
+ Coordinates { size: Size ((1,1)), position: Position ((1,1)) }
+ }
pub fn size(&self) -> &Size {
&self.size
}