Commit 020936a9 authored by hjk's avatar hjk
Browse files

bineditor: extend selection by 1 if cursor is left of anchor.

Feels more natural.

Reviewed-by: ck
parent 4db18745
......@@ -770,8 +770,14 @@ void BinEditor::paintEvent(QPaintEvent *e)
int foundPatternAt = findPattern(patternData, patternDataHex, patternOffset, patternOffset, &matchLength);
int selStart = qMin(m_cursorPosition, m_anchorPosition);
int selEnd = qMax(m_cursorPosition, m_anchorPosition);
int selStart, selEnd;
if (m_cursorPosition >= m_anchorPosition) {
selStart = m_anchorPosition;
selEnd = m_cursorPosition;
} else {
selStart = m_cursorPosition;
selEnd = m_anchorPosition + 1;
}
QString itemString(16*3, QLatin1Char(' '));
QChar *itemStringData = itemString.data();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment