mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 11:42:36 +01:00
Optimize recalculate display time
This commit is contained in:
parent
c70612f658
commit
f9754c1bdd
@ -325,13 +325,20 @@ namespace Nikse.SubtitleEdit.Core
|
||||
}
|
||||
}
|
||||
|
||||
public void RecalculateDisplayTimes(double maxCharactersPerSecond, List<int> selectedIndexes, double optimalCharactersPerSeconds, bool extendOnly = false)
|
||||
public void RecalculateDisplayTimes(double maxCharPerSec, List<int> selectedIndexes, double optimalCharPerSec, bool extendOnly = false)
|
||||
{
|
||||
for (int i = 0; i < _paragraphs.Count; i++)
|
||||
if (selectedIndexes != null)
|
||||
{
|
||||
if (selectedIndexes == null || selectedIndexes.Contains(i))
|
||||
foreach (var index in selectedIndexes)
|
||||
{
|
||||
RecalculateDisplayTime(maxCharactersPerSecond, i, optimalCharactersPerSeconds, extendOnly);
|
||||
RecalculateDisplayTime(maxCharPerSec, index, optimalCharPerSec, extendOnly);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < _paragraphs.Count; i++)
|
||||
{
|
||||
RecalculateDisplayTime(maxCharPerSec, i, optimalCharPerSec, extendOnly);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -371,7 +378,6 @@ namespace Nikse.SubtitleEdit.Core
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetFixedDuration(List<int> selectedIndexes, double fixedDurationMilliseconds)
|
||||
{
|
||||
for (int i = 0; i < _paragraphs.Count; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user