Skip to content

Commit f8923be

Browse files
authored
Fix issue with mixed border widths on Fabric (#11561)
* 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 * Change files
1 parent 657672e commit f8923be

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"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",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -897,11 +897,11 @@ bool CompositionBaseComponentView::TryUpdateSpecialBorderLayers(
897897
// We only handle a single borderStyle for now
898898
auto borderStyle = borderMetrics.borderStyles.left;
899899

900-
if (borderMetrics.borderColors.isUniform()) {
901-
if (!borderMetrics.borderWidths.left)
902-
return false;
903-
if (!facebook::react::isColorMeaningful(borderMetrics.borderColors.left))
904-
return false;
900+
bool hasMeaningfulColor =
901+
!borderMetrics.borderColors.isUniform() || !facebook::react::isColorMeaningful(borderMetrics.borderColors.left);
902+
bool hasMeaningfulWidth = !borderMetrics.borderWidths.isUniform() || (borderMetrics.borderWidths.left != 0);
903+
if (!hasMeaningfulColor && !hasMeaningfulWidth) {
904+
return false;
905905
}
906906

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

0 commit comments

Comments
 (0)