Skip to content

Commit

Permalink
Now it's able to calculate the draw quad by the shader.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Apr 30, 2022
1 parent bc79649 commit 3c317e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public IReadOnlyList<IShader> Shaders
if (value != null)
shaders.AddRange(value);

Invalidate(Invalidation.DrawNode);
Invalidate();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;
using System.Collections.Generic;
using osu.Framework.Graphics.Extensions;
using System.Linq;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Shaders;
Expand All @@ -17,8 +17,9 @@ public partial class LyricSpriteText
protected override Quad ComputeScreenSpaceDrawQuad()
{
// make draw size become bigger (for not masking the shader).
var newRectangle = DrawRectangle.Scale(2);
return ToScreenSpace(newRectangle);
var quad = ToScreenSpace(DrawRectangle);
return Shaders.OfType<IApplicableToDrawQuad>()
.Max(x => x?.ComputeScreenSpaceDrawQuad(quad)) ?? quad;
}

protected override DrawNode CreateDrawNode()
Expand Down

0 comments on commit 3c317e1

Please sign in to comment.