diff options
author | Linus Groh <mail@linusgroh.de> | 2020-05-25 17:04:53 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-25 18:14:25 +0200 |
commit | c378a1c730c998dc7f69571a3123a633010d2a3a (patch) | |
tree | bd0d8b5c9913a488fba05942cfaf88bd3e888615 | |
parent | fd7cbb5389fd916004c708bca119d96047f99aa1 (diff) | |
download | serenity-c378a1c730c998dc7f69571a3123a633010d2a3a.zip |
HexEditor: Fix "Selected Bytes" count for backwards selection
-rw-r--r-- | Applications/HexEditor/HexEditorWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Applications/HexEditor/HexEditorWidget.cpp b/Applications/HexEditor/HexEditorWidget.cpp index 59d887789e..565cd42c1c 100644 --- a/Applications/HexEditor/HexEditorWidget.cpp +++ b/Applications/HexEditor/HexEditorWidget.cpp @@ -58,7 +58,7 @@ HexEditorWidget::HexEditorWidget() m_statusbar->set_text(1, String::format("Edit Mode: %s", edit_mode == HexEditor::EditMode::Hex ? "Hex" : "Text")); m_statusbar->set_text(2, String::format("Selection Start: %d", selection_start)); m_statusbar->set_text(3, String::format("Selection End: %d", selection_end)); - m_statusbar->set_text(4, String::format("Selected Bytes: %d", (selection_end - selection_start) + 1)); + m_statusbar->set_text(4, String::format("Selected Bytes: %d", abs(selection_end - selection_start) + 1)); }; m_editor->on_change = [this] { |