Minor fix for waveform - don't move if no space to move whole line

This commit is contained in:
Nikolaj Olsson 2017-03-01 22:21:05 +01:00
parent 5c66f593fb
commit 70ce74e57f

View File

@ -1298,6 +1298,16 @@ namespace Nikse.SubtitleEdit.Controls
_mouseDownParagraph.StartTime.TotalMilliseconds = _wholeParagraphMinMilliseconds + 1;
_mouseDownParagraph.EndTime.TotalMilliseconds = _mouseDownParagraph.StartTime.TotalMilliseconds + durationMilliseconds;
}
if (PreventOverlap &&
(_mouseDownParagraph.StartTime.TotalMilliseconds <= _wholeParagraphMinMilliseconds ||
_mouseDownParagraph.EndTime.TotalMilliseconds >= _wholeParagraphMaxMilliseconds))
{
_mouseDownParagraph.StartTime.TotalMilliseconds = oldStart;
_mouseDownParagraph.EndTime.TotalMilliseconds = oldStart + durationMilliseconds;
return;
}
OnTimeChanged?.Invoke(this, new ParagraphEventArgs(seconds, _mouseDownParagraph, _oldParagraph, _mouseDownParagraphType) { AdjustMs = _mouseDownParagraph.StartTime.TotalMilliseconds - oldStart });
}
}