Skip to content
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

Fix issue with mixed border widths on Fabric #11561

Merged
merged 2 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Borders should show if mixed widths but not colors They were checking if the color was variable per side but assuming width wouldn't be. Fixes #11549",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -897,11 +897,11 @@ bool CompositionBaseComponentView::TryUpdateSpecialBorderLayers(
// We only handle a single borderStyle for now
auto borderStyle = borderMetrics.borderStyles.left;

if (borderMetrics.borderColors.isUniform()) {
if (!borderMetrics.borderWidths.left)
return false;
if (!facebook::react::isColorMeaningful(borderMetrics.borderColors.left))
return false;
bool hasMeaningfulColor =
!borderMetrics.borderColors.isUniform() || !facebook::react::isColorMeaningful(borderMetrics.borderColors.left);
bool hasMeaningfulWidth = !borderMetrics.borderWidths.isUniform() || (borderMetrics.borderWidths.left != 0);
if (!hasMeaningfulColor && !hasMeaningfulWidth) {
return false;
}

// Create the special border layers if they don't exist yet
Expand Down