Fixed de-selecting text in textbox via single click - thx XhmikosR :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@797 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-11-06 22:21:06 +00:00
parent 6616dce328
commit 0b48bbdef2

View File

@ -86,7 +86,13 @@ namespace Nikse.SubtitleEdit.Controls
_dragFromThis = false;
long milliseconds = (DateTime.Now.Ticks - _dragStartTicks) / 10000;
if (milliseconds < 400)
{
SelectionLength = 0;
if (index == Text.Length - 1 && index > 0)
index++;
SelectionStart = index;
return; // too fast - nobody can drag'n'drop this fast
}
if (index >= _dragStartFrom && index <= _dragStartFrom + _dragText.Length)
return; // don't drop same text at same position