Skip to content

Commit

Permalink
HexEditor: Use debgln_if
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendiadyoin1 authored and linusg committed Apr 16, 2021
1 parent b8d3816 commit 6c618eb
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Userland/Applications/HexEditor/HexEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ void HexEditor::mousedown_event(GUI::MouseEvent& event)
if (offset < 0 || offset >= static_cast<int>(m_buffer.size()))
return;

#if HEX_DEBUG
outln("HexEditor::mousedown_event(hex): offset={}", offset);
#endif
dbgln_if(HEX_DEBUG, "HexEditor::mousedown_event(hex): offset={}", offset);

m_edit_mode = EditMode::Hex;
m_byte_position = 0;
Expand All @@ -245,9 +243,7 @@ void HexEditor::mousedown_event(GUI::MouseEvent& event)
if (offset < 0 || offset >= static_cast<int>(m_buffer.size()))
return;

#if HEX_DEBUG
outln("HexEditor::mousedown_event(text): offset={}", offset);
#endif
dbgln_if(HEX_DEBUG, "HexEditor::mousedown_event(text): offset={}", offset);

m_position = offset;
m_byte_position = 0;
Expand Down Expand Up @@ -345,9 +341,7 @@ void HexEditor::scroll_position_into_view(int position)

void HexEditor::keydown_event(GUI::KeyEvent& event)
{
#if HEX_DEBUG
outln("HexEditor::keydown_event key={}", static_cast<u8>(event.key()));
#endif
dbgln_if(HEX_DEBUG, "HexEditor::keydown_event key={}", static_cast<u8>(event.key()));

if (event.key() == KeyCode::Key_Up) {
if (m_position - bytes_per_row() >= 0) {
Expand Down

0 comments on commit 6c618eb

Please sign in to comment.