Skip to content

Commit

Permalink
Fix incorrect scale handling
Browse files Browse the repository at this point in the history
  • Loading branch information
EVAST9919 committed Aug 28, 2024
1 parent f77f946 commit 0a75c42
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions osu.Framework/Graphics/Shapes/FastCircle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public FastCircleDrawNode(FastCircle source)

private Quad screenSpaceDrawQuad;
private Vector4 drawRectangle;
private Vector2 edgeSmoothness;
private Vector2 blend;
private IShader shader = null!;

public override void ApplyState()
{
base.ApplyState();

screenSpaceDrawQuad = Source.ScreenSpaceDrawQuad;
drawRectangle = new Vector4(0, 0, screenSpaceDrawQuad.Width, screenSpaceDrawQuad.Height);
drawRectangle = new Vector4(0, 0, Source.DrawWidth, Source.DrawHeight);
shader = Source.shader;
edgeSmoothness = new Vector2(Source.edgeSmoothness);
blend = new Vector2(Source.edgeSmoothness * Math.Min(Source.DrawWidth, Source.DrawHeight) / Math.Min(screenSpaceDrawQuad.Width, screenSpaceDrawQuad.Height));
}

protected override void Draw(IRenderer renderer)
Expand All @@ -89,33 +89,33 @@ protected override void Draw(IRenderer renderer)
vertexAction(new TexturedVertex2D(renderer)
{
Position = screenSpaceDrawQuad.BottomLeft,
TexturePosition = new Vector2(0, screenSpaceDrawQuad.Height),
TexturePosition = new Vector2(0, drawRectangle.W),
TextureRect = drawRectangle,
BlendRange = edgeSmoothness,
BlendRange = blend,
Colour = DrawColourInfo.Colour.BottomLeft.SRGB,
});
vertexAction(new TexturedVertex2D(renderer)
{
Position = screenSpaceDrawQuad.BottomRight,
TexturePosition = new Vector2(screenSpaceDrawQuad.Width, screenSpaceDrawQuad.Height),
TexturePosition = new Vector2(drawRectangle.Z, drawRectangle.W),
TextureRect = drawRectangle,
BlendRange = edgeSmoothness,
BlendRange = blend,
Colour = DrawColourInfo.Colour.BottomRight.SRGB,
});
vertexAction(new TexturedVertex2D(renderer)
{
Position = screenSpaceDrawQuad.TopRight,
TexturePosition = new Vector2(screenSpaceDrawQuad.Width, 0),
TexturePosition = new Vector2(drawRectangle.Z, 0),
TextureRect = drawRectangle,
BlendRange = edgeSmoothness,
BlendRange = blend,
Colour = DrawColourInfo.Colour.TopRight.SRGB,
});
vertexAction(new TexturedVertex2D(renderer)
{
Position = screenSpaceDrawQuad.TopLeft,
TexturePosition = new Vector2(0, 0),
TexturePosition = Vector2.Zero,
TextureRect = drawRectangle,
BlendRange = edgeSmoothness,
BlendRange = blend,
Colour = DrawColourInfo.Colour.TopLeft.SRGB,
});

Expand Down

0 comments on commit 0a75c42

Please sign in to comment.