Skip to content

Commit

Permalink
Merge pull request #54 from andy840119/fix-timing-issue
Browse files Browse the repository at this point in the history
fix time calculation.
  • Loading branch information
andy840119 authored Oct 2, 2021
2 parents 2488e73 + 4411f7f commit 850909d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,16 @@ protected override bool OnInvalidate(Invalidation invalidation, InvalidationSour
.OrderBy(x => x.Value).ToArray();

// get first time-tag relative start time.
var relativeTime = validTimeTag.FirstOrDefault().Value - Time.Current;
var currentTime = Time.Current;
var relativeTime = validTimeTag.FirstOrDefault().Value;

// should use absolute time to process time-tags.
using (frontLyricTextContainer.BeginAbsoluteSequence(Time.Current))
using (frontLyricTextContainer.BeginAbsoluteSequence(Time.Current))
using (frontLyricTextContainer.BeginAbsoluteSequence(currentTime))
using (frontLyricTextContainer.BeginAbsoluteSequence(currentTime))
{
// get transform sequence and set initial delay time.
var frontTransformSequence = frontLyricTextContainer.Delay(relativeTime).Then();
var backTransformSequence = backLyricTextContainer.Delay(relativeTime).Then();
var frontTransformSequence = frontLyricTextContainer.Delay(relativeTime - currentTime).Then();
var backTransformSequence = backLyricTextContainer.Delay(relativeTime - currentTime).Then();

foreach (var (textIndex, time) in validTimeTag)
{
Expand Down

0 comments on commit 850909d

Please sign in to comment.