mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:27:34 +00:00
HexEditor: Specify page skip size in multiples of the line height
This commit is contained in:
parent
bda737fde7
commit
ec34d60e5c
1 changed files with 2 additions and 2 deletions
|
@ -435,14 +435,14 @@ void HexEditor::keydown_event(GUI::KeyEvent& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.key() == KeyCode::Key_PageUp) {
|
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)
|
if (cursor_location_change > 0)
|
||||||
move_and_update_cursor_by(-cursor_location_change);
|
move_and_update_cursor_by(-cursor_location_change);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.key() == KeyCode::Key_PageDown) {
|
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)
|
if (cursor_location_change > 0)
|
||||||
move_and_update_cursor_by(cursor_location_change);
|
move_and_update_cursor_by(cursor_location_change);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue