Skip to content

Added values normalization in RangeToSweepConverter#490

Merged
SKProCH merged 1 commit intoAvaloniaCommunity:masterfrom
CrackAndDie:bugfix/fix-range-to-sweep-converter
Dec 10, 2025
Merged

Added values normalization in RangeToSweepConverter#490
SKProCH merged 1 commit intoAvaloniaCommunity:masterfrom
CrackAndDie:bugfix/fix-range-to-sweep-converter

Conversation

@CrackAndDie
Copy link
Contributor

Added values normalization so the correct angles would be applied to circular progress bars.
Issue:
The progress bar would be filled 100%:

<ProgressBar Classes="circular no-transitions" 
         Minimum="5"
         Maximum="14"
         Value="9"/>

but this one will be filled a bit less than a half:

<ProgressBar Classes="no-transitions" 
         Minimum="5"
         Maximum="14"
         Value="9"/>

Problem location:
The problem is in

var m = max - min;
return val / m * 360;

Fix:
Changed angle calculation.

Added values normalization so the correct angles would be applied to circular progress bars
@c3n9
Copy link
Contributor

c3n9 commented Dec 10, 2025

lgtm

@SKProCH SKProCH merged commit 4ff9c65 into AvaloniaCommunity:master Dec 10, 2025
@SKProCH
Copy link
Collaborator

SKProCH commented Dec 10, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants