1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

HexEditor: Specify page skip size in multiples of the line height

This commit is contained in:
premek 2022-10-29 00:27:30 +02:00 committed by Linus Groh
parent bda737fde7
commit ec34d60e5c

View file

@ -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;