Fix scaling of RadioButton widget #10777
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fixes: #4429
PR Checklist