diff --git a/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs b/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs index ec6a75c..4dd8107 100644 --- a/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs +++ b/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs @@ -448,13 +448,13 @@ public virtual void RefreshStateTransforms() if (!hasTimeTag || !hasText) return; - // todo: IApplicableToCharacterSize should affect padding in the masking container also. - // set initial width. // we should get width from child object because draw width haven't updated. var width = leftLyricText.Width; - leftLyricTextContainer.Width = 0; - rightLyricTextContainer.Width = width; + var startPosition = getTextIndexPosition(new TextIndex()); + var endPosition = width - startPosition; + leftLyricTextContainer.Width = startPosition; + rightLyricTextContainer.Width = endPosition; // get first time-tag relative start time. var currentTime = Time.Current; @@ -462,8 +462,8 @@ public virtual void RefreshStateTransforms() // get transform sequence and set initial delay time. var delay = relativeTime - currentTime; - var leftTransformSequence = leftLyricTextContainer.Delay(delay).ResizeWidthTo(0).Then(); - var rightTransformSequence = rightLyricTextContainer.Delay(delay).ResizeWidthTo(width).Then(); + var leftTransformSequence = leftLyricTextContainer.Delay(delay).ResizeWidthTo(startPosition).Then(); + var rightTransformSequence = rightLyricTextContainer.Delay(delay).ResizeWidthTo(endPosition).Then(); foreach ((var textIndex, double time) in validTimeTag) {