void UpdateMouseSelection(object sender, MouseEventArgs e)
{
if (!_mouseDown)
return;
_bpi = GetBytePositionInfo(new Point(e.X, e.Y));
long selEnd = _bpi.Index;
long realselStart;
long realselLength;
if (selEnd < _bpiStart.Index)
{
realselStart = selEnd;
realselLength = _bpiStart.Index - selEnd;
}
else if (selEnd > _bpiStart.Index)
{
realselStart = _bpiStart.Index;
realselLength = selEnd - realselStart;
}
else
{
realselStart = _hexBox._bytePos;
realselLength = 0;
}
if (realselStart != _hexBox._bytePos || realselLength != _hexBox._selectionLength)
{
_hexBox.InternalSelect(realselStart, realselLength);
_hexBox.ScrollByteIntoView(_bpi.Index);
}
}