|
9 | 9 |
|
10 | 10 | namespace winrt::Microsoft::ReactNative::Composition::implementation { |
11 | 11 |
|
12 | | -// Ideally isColorMeaningful would be sufficient here. But it appears to detect platformColors as not meaningful |
13 | | -// https://github.com/microsoft/react-native-windows/issues/14006 |
14 | | -bool isColorMeaningful( |
15 | | - const facebook::react::SharedColor &color, |
16 | | - winrt::Microsoft::ReactNative::Composition::implementation::Theme *theme) noexcept { |
17 | | - if (!color) { |
18 | | - return false; |
19 | | - } |
20 | | - |
21 | | - return theme->Color(*color).A > 0; |
22 | | -} |
23 | | - |
24 | 12 | // We don't want half pixel borders, or border radii - they lead to blurry borders |
25 | 13 | // Also apply scale factor to the radii at this point |
26 | 14 | void pixelRoundBorderRadii(facebook::react::BorderRadii &borderRadii, float scaleFactor) noexcept { |
@@ -354,7 +342,7 @@ void SetBorderLayerPropertiesCommon( |
354 | 342 | // Clear with transparency |
355 | 343 | pRT->Clear(); |
356 | 344 |
|
357 | | - if (!isColorMeaningful(borderColor, theme)) { |
| 345 | + if (!facebook::react::isColorMeaningful(borderColor)) { |
358 | 346 | return; |
359 | 347 | } |
360 | 348 |
|
@@ -738,7 +726,7 @@ bool BorderPrimitive::requiresBorder( |
738 | 726 | auto borderStyle = borderMetrics.borderStyles.left; |
739 | 727 |
|
740 | 728 | bool hasMeaningfulColor = |
741 | | - !borderMetrics.borderColors.isUniform() || isColorMeaningful(borderMetrics.borderColors.left, theme); |
| 729 | + !borderMetrics.borderColors.isUniform() || facebook::react::isColorMeaningful(borderMetrics.borderColors.left); |
742 | 730 | bool hasMeaningfulWidth = !borderMetrics.borderWidths.isUniform() || (borderMetrics.borderWidths.left != 0); |
743 | 731 | if (!hasMeaningfulColor || !hasMeaningfulWidth) { |
744 | 732 | return false; |
@@ -828,7 +816,7 @@ bool BorderPrimitive::TryUpdateSpecialBorderLayers( |
828 | 816 | auto borderStyle = borderMetrics.borderStyles.left; |
829 | 817 |
|
830 | 818 | bool hasMeaningfulColor = |
831 | | - !borderMetrics.borderColors.isUniform() || !isColorMeaningful(borderMetrics.borderColors.left, theme); |
| 819 | + !borderMetrics.borderColors.isUniform() || !facebook::react::isColorMeaningful(borderMetrics.borderColors.left); |
832 | 820 | bool hasMeaningfulWidth = !borderMetrics.borderWidths.isUniform() || (borderMetrics.borderWidths.left != 0); |
833 | 821 | if (!hasMeaningfulColor && !hasMeaningfulWidth) { |
834 | 822 | return false; |
|
0 commit comments