Skip to content

Commit 294b2e7

Browse files
ktraceSimsys
authored andcommitted
Changing the displayed characters in asciiArea
Show ASCII characters < " " and > "~" as "." Signed-off-by: Victor Kustov <ktrace@yandex.ru>
1 parent 16ec9b9 commit 294b2e7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/qhexedit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ void QHexEdit::paintEvent(QPaintEvent *event)
904904
if (_asciiArea)
905905
{
906906
int ch = (uchar)_dataShown.at(bPosLine + colIdx);
907-
if ( ch < 0x20 )
907+
if ( ch < ' ' || ch > '~' )
908908
ch = '.';
909909
r.setRect(pxPosAsciiX2, pxPosY - _pxCharHeight + _pxSelectionSub, _pxCharWidth, _pxCharHeight);
910910
painter.fillRect(r, c);
@@ -941,7 +941,7 @@ void QHexEdit::paintEvent(QPaintEvent *event)
941941
// every 2 hex there is 1 ascii
942942
int asciiPositionInShowData = hexPositionInShowData / 2;
943943
int ch = (uchar)_dataShown.at(asciiPositionInShowData);
944-
if ( ch < 0x20 )
944+
if (ch < ' ' || ch > '~')
945945
ch = '.';
946946
painter.drawText(_pxCursorX - pxOfsX, _pxCursorY, QChar(ch));
947947
}

0 commit comments

Comments
 (0)