Fixed small selection problems:
* When selecting character-wise backwards the initially selected char was deselected. * When first extending a selection and then moving the mouse back into the initial selection region (char, word, or line), the previously selected additional char/word/line would not be deselected (only when moving the mouse in the other direction out of the initial selection). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26389 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1933,8 +1933,19 @@ TermView::MouseMoved(BPoint where, uint32 transit, const BMessage *message)
|
|||||||
|
|
||||||
switch (fSelectGranularity) {
|
switch (fSelectGranularity) {
|
||||||
case SELECT_CHARS:
|
case SELECT_CHARS:
|
||||||
|
{
|
||||||
|
// If we just start selecting, we first select the initially
|
||||||
|
// hit char, so that we get a proper initial selection -- the char
|
||||||
|
// in question, which will thus always be selected, regardless of
|
||||||
|
// whether selecting forward or backward.
|
||||||
|
if (fInitialSelectionStart == fInitialSelectionEnd) {
|
||||||
|
_Select(fInitialSelectionStart, fInitialSelectionEnd, true,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
_ExtendSelection(_ConvertToTerminal(where), true, true);
|
_ExtendSelection(_ConvertToTerminal(where), true, true);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SELECT_WORDS:
|
case SELECT_WORDS:
|
||||||
_SelectWord(where, true, true);
|
_SelectWord(where, true, true);
|
||||||
break;
|
break;
|
||||||
@@ -2056,6 +2067,8 @@ TermView::_ExtendSelection(TermPos pos, bool inclusive,
|
|||||||
_Select(pos, end, false, !useInitialSelection);
|
_Select(pos, end, false, !useInitialSelection);
|
||||||
else if (pos > end)
|
else if (pos > end)
|
||||||
_Select(start, pos, false, !useInitialSelection);
|
_Select(start, pos, false, !useInitialSelection);
|
||||||
|
else if (useInitialSelection)
|
||||||
|
_Select(start, end, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2098,6 +2111,8 @@ TermView::_SelectWord(BPoint where, bool extend, bool useInitialSelection)
|
|||||||
_ExtendSelection(start, false, useInitialSelection);
|
_ExtendSelection(start, false, useInitialSelection);
|
||||||
else if (end > (useInitialSelection ? fInitialSelectionEnd : fSelEnd))
|
else if (end > (useInitialSelection ? fInitialSelectionEnd : fSelEnd))
|
||||||
_ExtendSelection(end, false, useInitialSelection);
|
_ExtendSelection(end, false, useInitialSelection);
|
||||||
|
else if (useInitialSelection)
|
||||||
|
_Select(start, end, false, false);
|
||||||
} else
|
} else
|
||||||
_Select(start, end, false, !useInitialSelection);
|
_Select(start, end, false, !useInitialSelection);
|
||||||
}
|
}
|
||||||
@@ -2114,7 +2129,8 @@ TermView::_SelectLine(BPoint where, bool extend, bool useInitialSelection)
|
|||||||
_ExtendSelection(start, false, useInitialSelection);
|
_ExtendSelection(start, false, useInitialSelection);
|
||||||
else if (end > (useInitialSelection ? fInitialSelectionEnd : fSelEnd))
|
else if (end > (useInitialSelection ? fInitialSelectionEnd : fSelEnd))
|
||||||
_ExtendSelection(end, false, useInitialSelection);
|
_ExtendSelection(end, false, useInitialSelection);
|
||||||
|
else if (useInitialSelection)
|
||||||
|
_Select(start, end, false, false);
|
||||||
} else
|
} else
|
||||||
_Select(start, end, false, !useInitialSelection);
|
_Select(start, end, false, !useInitialSelection);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user