Skip to content

Commit

Permalink
fixed HandyOrg#241
Browse files Browse the repository at this point in the history
  • Loading branch information
NaBian committed Dec 1, 2019
1 parent 8526d34 commit 2474e99
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
ItemIsDragging = true;
_isWaiting = true;
_dragPoint = e.GetPosition(parent);
_dragPoint = new Point(_dragPoint.X + +_scrollHorizontalOffset, _dragPoint.Y);
_dragPoint = new Point(_dragPoint.X + _scrollHorizontalOffset, _dragPoint.Y);
_mouseDownPoint = _dragPoint;
CaptureMouse();
}
Expand Down Expand Up @@ -432,6 +432,11 @@ void AnimationCompleted()
/// <returns></returns>
private int CalLocationIndex(double left)
{
if (_isWaiting)
{
return CurrentIndex;
}

var maxIndex = TabControlParent.Items.Count - 1;
var div = (int)(left / ItemWidth);
var rest = left % ItemWidth;
Expand Down

0 comments on commit 2474e99

Please sign in to comment.