Terminal: fix copy to clipboard of bottom up selection

The multi line selection from bottom right corner to top left was broken
for copy to clipboard.

Change-Id: Ica40ec2ce5bb7b9d4b0187ebb454cd16e039e339
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Cristian Adam
2023-03-09 18:52:02 +01:00
parent b138ab1510
commit 215bd2ef2b

View File

@@ -1041,6 +1041,8 @@ void TerminalWidget::mouseMoveEvent(QMouseEvent *event)
if (start > newEnd) { if (start > newEnd) {
std::swap(start, newEnd); std::swap(start, newEnd);
} }
if (start < 0)
start = 0;
if (m_selectLineMode) { if (m_selectLineMode) {
m_selection->start = m_surface->gridToPos({0, m_surface->posToGrid(start).y()}); m_selection->start = m_surface->gridToPos({0, m_surface->posToGrid(start).y()});