mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixed a bug appearing when selecting over multiple lines in different directions.
This commit is contained in:
parent
4c4d1d2042
commit
423ef19c8f
1 changed files with 12 additions and 2 deletions
|
@ -899,12 +899,22 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||||
if (wordStart < this->selection_.start.charIndex &&
|
if (wordStart < this->selection_.start.charIndex &&
|
||||||
!this->dCSelection_.selectingRight) {
|
!this->dCSelection_.selectingRight) {
|
||||||
this->dCSelection_.selectingLeft = true;
|
this->dCSelection_.selectingLeft = true;
|
||||||
this->setSelection(newStart, this->selection_.end);
|
if (wordStart > this->dCSelection_.originalEnd) {
|
||||||
|
this->setSelection(this->dCSelection_.origStartItem,
|
||||||
|
newEnd);
|
||||||
|
} else {
|
||||||
|
this->setSelection(newStart, this->selection_.end);
|
||||||
|
}
|
||||||
// Selecting to the right
|
// Selecting to the right
|
||||||
} else if (wordEnd > this->selection_.end.charIndex &&
|
} else if (wordEnd > this->selection_.end.charIndex &&
|
||||||
!this->dCSelection_.selectingLeft) {
|
!this->dCSelection_.selectingLeft) {
|
||||||
this->dCSelection_.selectingRight = true;
|
this->dCSelection_.selectingRight = true;
|
||||||
this->setSelection(this->selection_.start, newEnd);
|
if (wordEnd < this->dCSelection_.originalStart) {
|
||||||
|
this->setSelection(newStart,
|
||||||
|
this->dCSelection_.origEndItem);
|
||||||
|
} else {
|
||||||
|
this->setSelection(this->selection_.start, newEnd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Swapping from selecting left to selecting right
|
// Swapping from selecting left to selecting right
|
||||||
if (wordStart > this->selection_.start.charIndex &&
|
if (wordStart > this->selection_.start.charIndex &&
|
||||||
|
|
Loading…
Reference in a new issue