-
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
IsNullOrEmpty for Paint not returning true if Color(s) are not set #15668
Conversation
Hey there @mos379! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
This PR is on the right track, but after my first comment about adding a test, I think we may also actually want to rather make null become white instead. So a "blank" gradient is the same as 2 white stops?
What happens if one of the stops is null - such that start and end are not null, but there is one in the middle that is null.
@jsuarezruiz thoughts?
@@ -28,7 +28,7 @@ public static bool IsNullOrEmpty([NotNullWhen(true)] this Paint? paint) | |||
return solidPaint == null || solidPaint.Color == null; | |||
|
|||
if (paint is GradientPaint gradientPaint) | |||
return gradientPaint == null || gradientPaint.GradientStops.Length == 0; | |||
return gradientPaint == null || gradientPaint.GradientStops.Length == 0 || gradientPaint.StartColor == null || gradientPaint.EndColor == null; |
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.
What happens if just one color is set? Maybe a null color should go through to Graphics, but then be set to white? The default in graphics seems to be white, so we could replace nulls in the stops with white?
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.
Mnn, could be an option. i changed this validation for now to check if the gradient StartColor and EndColor is null. In that case, without start and end colors, we can consider the gradient empty.
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.
@mattleibow how much longer do we have to wait for this tiny fix?
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
@mos379 I was unable to reproduce the issue that the PR was meant to solve. Are you sure we still need this? Thanks! |
Hi @mos379. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time. |
This comment was marked as outdated.
This comment was marked as outdated.
@samhouts this is still the case crashing my application
crashes tested with 8.0.100-rc.1.23455.8 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
/azp run |
This comment was marked as outdated.
This comment was marked as outdated.
Oh this is still in the process 😂 |
Azure Pipelines successfully started running 3 pipeline(s). |
…15668) * IsNullOrEmpty for Paint not returning true if Colors are not set * Updated unit test * Updated tests * More tests * Added more tests * Updated conditions * Added more tests * Changed condition to work when only one collor is missing --------- Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
WOW after almost 2 years :) |
…otnet#15668) * IsNullOrEmpty for Paint not returning true if Colors are not set * Updated unit test * Updated tests * More tests * Added more tests * Updated conditions * Added more tests * Changed condition to work when only one collor is missing --------- Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Description of Change
Adding additional condition for IsNullOrEmpty check
Issues Fixed
Fixes #15667