forked from qt-creator/qt-creator
Terminal: Fix line selection mode
Change-Id: I03d4bf7343a49b19edfcb20d1eb57bfe18703ddf Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -1007,7 +1007,7 @@ void TerminalWidget::mousePressEvent(QMouseEvent *event)
|
||||
m_selection->start = m_surface->gridToPos(
|
||||
{0, m_surface->posToGrid(m_selection->start).y()});
|
||||
m_selection->end = m_surface->gridToPos(
|
||||
{viewport()->width(), m_surface->posToGrid(m_selection->end).y()});
|
||||
{m_surface->liveSize().width(), m_surface->posToGrid(m_selection->end).y()});
|
||||
} else {
|
||||
m_selectLineMode = false;
|
||||
int pos = m_surface->gridToPos(globalToGrid(viewportToGlobal(event->pos())));
|
||||
@@ -1037,8 +1037,14 @@ void TerminalWidget::mouseMoveEvent(QMouseEvent *event)
|
||||
std::swap(start, newEnd);
|
||||
}
|
||||
|
||||
m_selection->start = start;
|
||||
m_selection->end = newEnd;
|
||||
if (m_selectLineMode) {
|
||||
m_selection->start = m_surface->gridToPos({0, m_surface->posToGrid(start).y()});
|
||||
m_selection->end = m_surface->gridToPos(
|
||||
{m_surface->liveSize().width(), m_surface->posToGrid(newEnd).y()});
|
||||
} else {
|
||||
m_selection->start = start;
|
||||
m_selection->end = newEnd;
|
||||
}
|
||||
|
||||
if (old != *m_selection || selectionLog().isDebugEnabled())
|
||||
updateViewport();
|
||||
|
||||
Reference in New Issue
Block a user