Skip to content

Commit

Permalink
Improve ProgressClipVariable logic
Browse files Browse the repository at this point in the history
  • Loading branch information
VolcanicArts committed Jul 24, 2024
1 parent c4eb58c commit 1bd97ef
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ protected override string Format(object value)
{
if (UseVisual)
{
var progressPercentage = VisualResolution * (float)value;
var dotPosition = (int)(MathF.Floor(progressPercentage * 10f) / 10f);
var dotPosition = VisualResolution * (float)value;

var visual = string.Empty;
visual += VisualStart;

for (var i = 0; i < VisualResolution; i++)
{
visual += i == dotPosition ? VisualPosition : VisualLine;
visual += (i <= dotPosition && i + 1 > dotPosition) ? VisualPosition : VisualLine;
}

visual += VisualEnd;
Expand Down

0 comments on commit 1bd97ef

Please sign in to comment.