From ec34d60e5c195ce06602b2189590e49fc84767e8 Mon Sep 17 00:00:00 2001 From: premek <1145361+premek@users.noreply.github.com> Date: Sat, 29 Oct 2022 00:27:30 +0200 Subject: [PATCH] HexEditor: Specify page skip size in multiples of the line height --- Userland/Applications/HexEditor/HexEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index 247539c126..5824e3bfa4 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -435,14 +435,14 @@ void HexEditor::keydown_event(GUI::KeyEvent& event) } if (event.key() == KeyCode::Key_PageUp) { - auto cursor_location_change = min(bytes_per_row() * visible_content_rect().height(), m_position); + auto cursor_location_change = min(bytes_per_row() * floor(visible_content_rect().height() / line_height()), m_position); if (cursor_location_change > 0) move_and_update_cursor_by(-cursor_location_change); return; } if (event.key() == KeyCode::Key_PageDown) { - auto cursor_location_change = min(bytes_per_row() * visible_content_rect().height(), m_document->size() - m_position); + auto cursor_location_change = min(bytes_per_row() * floor(visible_content_rect().height() / line_height()), m_document->size() - m_position); if (cursor_location_change > 0) move_and_update_cursor_by(cursor_location_change); return;