Skip to content

Commit

Permalink
Avoid showing a extra digit for addresses
Browse files Browse the repository at this point in the history
The address space range is non-inclusive, so the last possible address
is one less than the range.
  • Loading branch information
ptxmac committed Jul 30, 2023
1 parent ecbc5ae commit 94e63c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl MemoryEditor {
let line_height = self.get_line_height(ui);
let address_space = self.address_ranges.get(&selected_address_range).unwrap().clone();
// This is janky, but can't think of a better way.
let address_characters = format!("{:X}", address_space.end).chars().count();
let address_characters = format!("{:X}", address_space.end -1).chars().count();
let max_lines = (address_space.len() + column_count - 1) / column_count; // div_ceil

// For when we're editing memory, don't use the `Response` object as that would screw over downward scrolling.
Expand Down

0 comments on commit 94e63c6

Please sign in to comment.