mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Update paragraph end time in KaraokeEffect class
Moved the procedure of setting the end time of the last paragraph from the EffectKaraoke form to the KaraokeEffect class. This change ensures that the proper end time for each animation is set directly within the class where they are created, promoting better code organization.
This commit is contained in:
parent
9cc215b77d
commit
396adfb1a9
@ -32,6 +32,11 @@ namespace Nikse.SubtitleEdit.Core.Common.TextEffect
|
||||
animations.Add(new Paragraph(startTime, endTime, result[i]));
|
||||
}
|
||||
|
||||
if (animations.Count > 0)
|
||||
{
|
||||
animations[animations.Count - 1].EndTime.TotalMilliseconds = paragraph.EndTime.TotalMilliseconds;
|
||||
}
|
||||
|
||||
return animations;
|
||||
}
|
||||
|
||||
|
@ -120,12 +120,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var delaySeconds = (double)numericUpDownDelay.Value;
|
||||
var karaokeEffect = new KaraokeEffect(SelectStrategy());
|
||||
_animation.AddRange(karaokeEffect.Transform(_paragraph, panelColor.BackColor, delaySeconds * TimeCode.BaseUnit));
|
||||
|
||||
// All remaining time should go to the last paragraph.
|
||||
if (_animation.Count > 0)
|
||||
{
|
||||
_animation[_animation.Count - 1].EndTime.TotalMilliseconds = _paragraph.EndTime.TotalMilliseconds;
|
||||
}
|
||||
}
|
||||
|
||||
private TextEffectBase SelectStrategy()
|
||||
|
Loading…
Reference in New Issue
Block a user