Fixed a bug reported by kirilla:

* the textview now only initiates a drag after the mouse has been moved to 
  another offset, making it possible to click into the selection in order to 
  position the caret at the offset corresponding to the point of the click
  (just as R5 does it)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30518 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2009-04-30 19:56:54 +00:00
parent c39ecc608f
commit c27ffb3a23

View File

@ -4459,15 +4459,19 @@ BTextView::_PerformMouseMoved(BPoint where, uint32 code)
if (fTrackingMouse == NULL)
return false;
int32 currentOffset = OffsetAt(where);
if (fTrackingMouse->selectionRect.IsValid()
&& fTrackingMouse->selectionRect.Contains(where)) {
_StopMouseTracking();
_InitiateDrag();
return true;
// we are tracking the mouse for drag action, if the mouse has moved
// from where it was clicked, we initiate a drag now:
if (currentOffset != fTrackingMouse->clickOffset) {
_StopMouseTracking();
_InitiateDrag();
return true;
}
return false;
}
int32 currentOffset = OffsetAt(where);
switch (fClickCount) {
case 3:
// triple click, extend selection linewise