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

Fix stroke width scaling in hue ring #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JCapucho
Copy link

@JCapucho JCapucho commented Aug 4, 2022

The hue ring despite accepting a different stroke width from 20.0 seems to have some bits hard coded in such a way that different values cause the ui to not render correctly.

This PR fixes that by first ensuring that the HueRingPainter always renders inbound (see the first commit message for more information about the problem), secondly by changing the hard coded parts to scale with stroke width and finally by also scaling the thumb of the ring.

Old New
Normal stroke width 20.0 old-normal old-big
Big stroke width 40.0 new-normal new-big

The hue ring was rendering outside of it's bounds because drawCircle
draws the stroke width half before the radius and the other half after.

This commit fixes that by subtracting half the stroke width from the
radius.

HueRingPicker was adjusted to retain it's previous UI and to allow for
larger stroke widths without clipping
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