From 583c9de6d78ee1d2d9c37b44fb85581c6f1854d6 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 24 Nov 2023 06:19:37 +0300 Subject: [PATCH] Make CircularProgressDrawNode and properties protected --- .../UserInterface/CircularProgress.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Framework/Graphics/UserInterface/CircularProgress.cs b/osu.Framework/Graphics/UserInterface/CircularProgress.cs index 04b43c78af..e2a0b61f97 100644 --- a/osu.Framework/Graphics/UserInterface/CircularProgress.cs +++ b/osu.Framework/Graphics/UserInterface/CircularProgress.cs @@ -89,7 +89,7 @@ public bool RoundedCaps } } - private class CircularProgressDrawNode : SpriteDrawNode + protected class CircularProgressDrawNode : SpriteDrawNode { public new CircularProgress Source => (CircularProgress)base.Source; @@ -98,28 +98,28 @@ public CircularProgressDrawNode(CircularProgress source) { } - private float innerRadius; - private float progress; - private float texelSize; - private bool roundedCaps; + protected float InnerRadius { get; private set; } + protected float Progress { get; private set; } + protected float TexelSize { get; private set; } + protected bool RoundedCaps { get; private set; } public override void ApplyState() { base.ApplyState(); - innerRadius = Source.innerRadius; - progress = Math.Abs((float)Source.current.Value); - roundedCaps = Source.roundedCaps; + InnerRadius = Source.innerRadius; + Progress = Math.Abs((float)Source.current.Value); + RoundedCaps = Source.roundedCaps; // smoothstep looks too sharp with 1px, let's give it a bit more - texelSize = 1.5f / ScreenSpaceDrawQuad.Size.X; + TexelSize = 1.5f / ScreenSpaceDrawQuad.Size.X; } private IUniformBuffer parametersBuffer; protected override void Blit(IRenderer renderer) { - if (innerRadius == 0 || (!roundedCaps && progress == 0)) + if (InnerRadius == 0 || (!RoundedCaps && Progress == 0)) return; base.Blit(renderer); @@ -132,10 +132,10 @@ protected override void BindUniformResources(IShader shader, IRenderer renderer) parametersBuffer ??= renderer.CreateUniformBuffer(); parametersBuffer.Data = new CircularProgressParameters { - InnerRadius = innerRadius, - Progress = progress, - TexelSize = texelSize, - RoundedCaps = roundedCaps, + InnerRadius = InnerRadius, + Progress = Progress, + TexelSize = TexelSize, + RoundedCaps = RoundedCaps, }; shader.BindUniformBlock("m_CircularProgressParameters", parametersBuffer);