Skip to content

Fix scaling of RadioButton widget #10777

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

Closed
wants to merge 2 commits into from

Conversation

Abdul-Miraj
Copy link
Contributor

@Abdul-Miraj Abdul-Miraj commented Mar 14, 2018

PR Summary

This fix scales the radio buttons correctly with the size of the legend by taking the height that is already calculated for each section of the legend, which is defined by the variable dy (line 984). I took the dy value and converted appropriately into a radius (by dividing the value by 2) and subtracting a very small unit to allow for some spacing for in between the buttons. I made it default back into the previously hard-coded value of 0.05 if the value of the radius is any bigger so in the case where there isn't many radio buttons, they wouldn't be huge. Previously the value of the RadioButtons were set to 0.05 thus when the space given for each radio button was less then the 0.05 unit the buttons would overlap onto eachother.

Note: The tests seem to be failing at the image comparison tests for the radio button. Not entirely sure why, the test pass locally on my own machine. Any insight would be helpful, thank you.

before

after

Fixes: #4429

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant

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

Successfully merging this pull request may close these issues.

Error calculating scaling for radiobutton widget.
3 participants