forked from qt-creator/qt-creator
bineditor: extend selection by 1 if cursor is left of anchor.
Feels more natural. Reviewed-by: ck
This commit is contained in:
@@ -770,8 +770,14 @@ void BinEditor::paintEvent(QPaintEvent *e)
|
|||||||
|
|
||||||
int foundPatternAt = findPattern(patternData, patternDataHex, patternOffset, patternOffset, &matchLength);
|
int foundPatternAt = findPattern(patternData, patternDataHex, patternOffset, patternOffset, &matchLength);
|
||||||
|
|
||||||
int selStart = qMin(m_cursorPosition, m_anchorPosition);
|
int selStart, selEnd;
|
||||||
int selEnd = qMax(m_cursorPosition, m_anchorPosition);
|
if (m_cursorPosition >= m_anchorPosition) {
|
||||||
|
selStart = m_anchorPosition;
|
||||||
|
selEnd = m_cursorPosition;
|
||||||
|
} else {
|
||||||
|
selStart = m_cursorPosition;
|
||||||
|
selEnd = m_anchorPosition + 1;
|
||||||
|
}
|
||||||
|
|
||||||
QString itemString(16*3, QLatin1Char(' '));
|
QString itemString(16*3, QLatin1Char(' '));
|
||||||
QChar *itemStringData = itemString.data();
|
QChar *itemStringData = itemString.data();
|
||||||
|
|||||||
Reference in New Issue
Block a user