From 3c317e14f0844560b82c52a5adcca033d693aea5 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 1 May 2022 01:00:27 +0800 Subject: [PATCH] Now it's able to calculate the draw quad by the shader. --- osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs | 2 +- .../Graphics/Sprites/LyricSpriteText_DrawNode.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs index 90267127..a0b5ac03 100644 --- a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs +++ b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs @@ -113,7 +113,7 @@ public IReadOnlyList Shaders if (value != null) shaders.AddRange(value); - Invalidate(Invalidation.DrawNode); + Invalidate(); } } diff --git a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs index 1d690135..ccbb243f 100644 --- a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs +++ b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs @@ -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; @@ -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() + .Max(x => x?.ComputeScreenSpaceDrawQuad(quad)) ?? quad; } protected override DrawNode CreateDrawNode()