Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bias toward nearest whole percentage #128

Open
wants to merge 3 commits into
base: frac
Choose a base branch
from

Conversation

andeston
Copy link
Contributor

Summary

Fixes consistency issues for devices with low precision when adding or subtracting percentages.

Fixes #118

Behavior

Before

$ ./brightnessctl -m --frac s 50%
amdgpu_bl1,backlight,128,50.2%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,154,60.39%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,180,70.59%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,206,80.78%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,232,90.98%,255

After

$ ./brightnessctl -m --frac s 50%
amdgpu_bl1,backlight,128,50.2%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,153,60%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,179,70.2%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,204,80%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,230,90.2%,255

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.

1 participant