-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[iOS] RadioButton throws CGContextSetLineWidth - Fix #25542
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
border.SetBinding(Border.StrokeThicknessProperty, static (RadioButton rb) => rb.BorderWidth, source: RelativeBindingSource.TemplatedParent); | ||
|
||
// NonNegativeValueConverter ensures that StrokeThickness remains non-negative as the default value of -1 triggers a CGContextSetLineWidth error on iOS. | ||
border.SetBinding(Border.StrokeThicknessProperty, static (RadioButton rb) => rb.BorderWidth, source: RelativeBindingSource.TemplatedParent, converter: new NonNegativeValueConverter()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be fixed inside the Border control?
So the border control could also check if this value is getting set to -1?
This fix feels isolated to only fixes RB's use of Border vs border as a larger use case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
0dd9c15
to
6db3d42
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Description of Change
The error occurred because the default value for Border.StrokeThickness was set to -1. Instead of changing this default to 0, I implemented a converter that ensures Border.StrokeThickness never receives negative values.
Issues Fixed
Fixes #25273