Use const variable as base unit of time

This commit is contained in:
ivandrofly 2015-06-12 22:54:24 +01:00
parent 2a07eb0e20
commit b1ce10ef24

View File

@ -11,6 +11,7 @@ namespace Nikse.SubtitleEdit.Forms
private Subtitle _subtitle;
private Subtitle _fixedSubtitle;
private Dictionary<Paragraph, string> _dic;
private const double baseUnit = 1000.0;
public Subtitle FixedSubtitle { get { return _fixedSubtitle; } }
@ -84,7 +85,7 @@ namespace Nikse.SubtitleEdit.Forms
var difMs = Math.Abs(cur.EndTime.TotalMilliseconds - next.StartTime.TotalMilliseconds);
if (difMs < (double)numericUpDownMaxMs.Value && difMs > minMsBetweenLines && numericUpDownMaxMs.Value > minMsBetweenLines)
{
before = string.Format("{0:0.000}", (next.StartTime.TotalMilliseconds - cur.EndTime.TotalMilliseconds) / 1000.0);
before = string.Format("{0:0.000}", (next.StartTime.TotalMilliseconds - cur.EndTime.TotalMilliseconds) / baseUnit);
if (radioButtonDivideEven.Checked && next.StartTime.TotalMilliseconds > cur.EndTime.TotalMilliseconds)
{
double half = (next.StartTime.TotalMilliseconds - cur.EndTime.TotalMilliseconds) / 2.0;
@ -100,9 +101,9 @@ namespace Nikse.SubtitleEdit.Forms
{
string info = string.Empty;
if (!string.IsNullOrEmpty(before))
info = string.Format("{0} => {1:0.000}", before, msToNext / 1000.0);
info = string.Format("{0} => {1:0.000}", before, msToNext / baseUnit);
else
info = string.Format("{0:0.000}", msToNext / 1000.0);
info = string.Format("{0:0.000}", msToNext / baseUnit);
_dic.Add(cur, info);
}
}