diff options
author | Canop <cano.petrole@gmail.com> | 2021-11-30 22:17:11 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-11-30 22:17:11 +0100 |
commit | ffaa167cfcc97f5197e9291a88918cbf889c9f08 (patch) | |
tree | ed62af15b6339f02716f5c53037944f481621af9 /src/hex | |
parent | dbc814424d72554488c8131b040ec8126a05672a (diff) |
fix hex view sometimes losing 1 or 2 ASCII characters
Diffstat (limited to 'src/hex')
-rw-r--r-- | src/hex/hex_view.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/hex/hex_view.rs b/src/hex/hex_view.rs index 40c072d..66de990 100644 --- a/src/hex/hex_view.rs +++ b/src/hex/hex_view.rs @@ -103,7 +103,7 @@ impl HexView { let page = self.get_page(self.scroll, line_count)?; let addresses_len = if self.len < 0xffff { 4 - } else if self.len < 0xffffff { + } else if self.len < 0xff_ffff { 6 } else { 8 @@ -116,7 +116,11 @@ impl HexView { let mut chars_middle_space = false; let mut inter_hex = false; let mut chars = false; - let mut rem = area.width as i32 - 32; // 32: minimum, tight + const MIN: i32 = + 1 // margin + + 32 // 32 hex + + 1; // scrollbar + let mut rem = area.width as i32 - MIN; if rem > 17 { chars = true; rem -= 17; |