mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-04-26 22:42:28 +00: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:
committed by
Andreas Kling
parent
5e66eda688
commit
b2a6d2cea4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user