-
Notifications
You must be signed in to change notification settings - Fork 26
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
Non uniform corner radius support #769
Conversation
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.
@rafael-rosa-knowcode I think you made some tests for these changes no?
Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-769.eastus2.azurestaticapps.net |
src/Uno.Toolkit.Skia.WinUI/Controls/Shadows/ShadowContainer.Paint.cs
Outdated
Show resolved
Hide resolved
@@ -175,6 +184,24 @@ public void ClipToContent(ShadowPaintState state, SKCanvas canvas) | |||
canvas.ClipRoundRect(GetContentShape(state), antialias: true); | |||
} | |||
|
|||
public static bool IsCornerRadiusProportional(CornerRadius CornerRadius) |
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.
rename parameter to CornerRadius cornerRadius
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.
@@ -175,6 +184,24 @@ public void ClipToContent(ShadowPaintState state, SKCanvas canvas) | |||
canvas.ClipRoundRect(GetContentShape(state), antialias: true); | |||
} | |||
|
|||
public static bool IsCornerRadiusProportional(CornerRadius CornerRadius) |
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.
move IsCornerRadiusProportional + GetPointsFromCornerRadius above ClipToContent
helper methods should be grouped together
also they are only used within this class, so you can just mark them as private
maybe consider dropping static
, so you can just access local property
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.
|
||
public static SKPoint[] GetPointsFromCornerRadius(CornerRadius CornerRadius, float pixelRatio) | ||
{ | ||
return new SKPoint[] |
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.
return new[] { CornerRadius.TopLeft, .TR, .BR, .BL }
.Select(x => (float)x * pixelRatio))
.Select(x => new SKPoint(x, x))
.ToArray();
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.
maybe consider inline this into GetContentShape's else branch
since this is not reused, and doesnt really encapsulate much
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.
Co-authored-by: Steve Bilogan <steve.bilogan@gmail.com>
Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-769.eastus2.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-769.eastus2.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-769.eastus2.azurestaticapps.net |
@Mergifyio backport legacy/3x release/stable/3.1 |
🟠 Waiting for conditions to match
|
Closed in favor of #757 |
GitHub Issue (If applicable): closes #735
#735
Related to #754
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Today the ShadowContainer just have the uniform corner radius support
What is the new behavior?
Now the ShadowContainer have the non uniform corner radius support
Inner
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Internal Issue (If applicable):