mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 01:59:14 +03:00
HexEditor: Don't update selection numbers when clicking the last+1 char
Clicking at the cell after the last one, where there's no character, used to update the selection from/to numbers. Since there's no character there, that shouldn't happen.
This commit is contained in:
parent
5e66eda688
commit
b2a6d2cea4
Notes:
sideshowbarker
2024-07-19 00:32:55 +09:00
Author: https://github.com/rok-povsic Commit: https://github.com/SerenityOS/serenity/commit/b2a6d2cea46 Pull-request: https://github.com/SerenityOS/serenity/pull/4568 Issue: https://github.com/SerenityOS/serenity/issues/3555
@ -217,7 +217,7 @@ void HexEditor::mousedown_event(GUI::MouseEvent& event)
|
||||
auto byte_y = (absolute_y - hex_start_y) / line_height();
|
||||
auto offset = (byte_y * m_bytes_per_row) + byte_x;
|
||||
|
||||
if (offset < 0 || offset > static_cast<int>(m_buffer.size()))
|
||||
if (offset < 0 || offset >= static_cast<int>(m_buffer.size()))
|
||||
return;
|
||||
|
||||
#ifdef HEX_DEBUG
|
||||
@ -239,7 +239,7 @@ void HexEditor::mousedown_event(GUI::MouseEvent& event)
|
||||
auto byte_y = (absolute_y - text_start_y) / line_height();
|
||||
auto offset = (byte_y * m_bytes_per_row) + byte_x;
|
||||
|
||||
if (offset < 0 || offset > static_cast<int>(m_buffer.size()))
|
||||
if (offset < 0 || offset >= static_cast<int>(m_buffer.size()))
|
||||
return;
|
||||
|
||||
#ifdef HEX_DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user