diff options
author | rabite <rabite@posteo.de> | 2019-03-11 00:01:28 +0100 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-03-11 00:01:28 +0100 |
commit | 5b9a150a10411dcc47bd6340aa33fa8423aaa2be (patch) | |
tree | 731746fa1faa6110d256990c3085de6f2834efe9 /src/coordinates.rs | |
parent | b332c4fb116302117b584cd0cbf440266e00e17e (diff) |
bookmarks
Diffstat (limited to 'src/coordinates.rs')
-rw-r--r-- | src/coordinates.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/coordinates.rs b/src/coordinates.rs index 5861f72..df16791 100644 --- a/src/coordinates.rs +++ b/src/coordinates.rs @@ -28,6 +28,30 @@ impl Coordinates { // &self.size // } + pub fn set_size(&mut self, x: u16, y: u16) { + self.size.0 = (x, y); + } + + pub fn set_xsize(&mut self, x: u16) { + (self.size.0).0 = x; + } + + pub fn set_ysize(&mut self, y: u16) { + (self.size.0).1 = y; + } + + pub fn set_position(&mut self, x: u16, y: u16) { + self.position.0 = (x, y); + } + + pub fn set_xpos(&mut self, x: u16) { + (self.position.0).0 = x; + } + + pub fn set_ypos(&mut self, y: u16) { + (self.position.0).1 = y; + } + pub fn xsize(&self) -> u16 { self.size.xsize() } @@ -36,6 +60,14 @@ impl Coordinates { self.size.ysize() } + pub fn xpos(&self) -> u16 { + self.position.position().0 + } + + pub fn ypos(&self) -> u16 { + self.position.position().1 + } + pub fn position(&self) -> &Position { &self.position } |