diff options
author | rabite <rabite@posteo.de> | 2019-03-20 13:58:59 +0100 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-03-20 13:58:59 +0100 |
commit | 9a711bbe96d753d0dbf70007adc0ff89823aa9ad (patch) | |
tree | f8c0fc8cf12967a5c1a5409b37f6800a050a5c27 /src/coordinates.rs | |
parent | c2297ab4945d010d4106d35a34ec83314891c34f (diff) |
handle long lines in status/footer
Diffstat (limited to 'src/coordinates.rs')
-rw-r--r-- | src/coordinates.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/coordinates.rs b/src/coordinates.rs index 735286a..6453ad9 100644 --- a/src/coordinates.rs +++ b/src/coordinates.rs @@ -60,6 +60,10 @@ impl Coordinates { (self.position.0).1 = y; } + pub fn xsize_u(&self) -> usize { + self.size.size_u().0 + } + pub fn xsize(&self) -> u16 { self.size.xsize() } @@ -115,7 +119,7 @@ impl Size { } pub fn size_u(&self) -> (usize, usize) { let (xsize, ysize) = self.0; - (xsize as usize, ysize as usize) + ((xsize-1) as usize, (ysize-1) as usize) } pub fn xsize(&self) -> u16 { (self.0).0 @@ -131,7 +135,7 @@ impl Position { } pub fn position_u(&self) -> (usize, usize) { let (xpos, ypos) = self.0; - (xpos as usize, ypos as usize) + ((xpos-1) as usize, (ypos-1) as usize) } pub fn x(&self) -> u16 { (self.0).0 |