Skip to content

Commit d82634e

Browse files
committed
fix: merge related patches and remove unnecessary changes
1 parent 4cc929c commit d82634e

3 files changed

Lines changed: 349 additions & 603 deletions

patches/react-native/react-native+0.83.1+040+nested-text-border-width.patch

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt
2-
index 0f1f176..53faf04 100644
2+
index 0f1f176d50c..53faf049df6 100644
33
--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt
44
+++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt
55
@@ -80,6 +80,54 @@ public class TextAttributeProps private constructor() {
@@ -92,7 +92,7 @@ index 0f1f176..53faf04 100644
9292
}
9393

9494
diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt
95-
index 5e7895c..7d2774b 100644
95+
index 5e7895c3c50..7d2774b443f 100644
9696
--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt
9797
+++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt
9898
@@ -268,27 +268,44 @@ internal object TextLayoutManager {
@@ -225,7 +225,7 @@ index 5e7895c..7d2774b 100644
225225
}
226226

227227
diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactBackgroundDrawSpan.kt b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactBackgroundDrawSpan.kt
228-
index 326b049..48f6592 100644
228+
index 326b049ce2e..80f8d389475 100644
229229
--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactBackgroundDrawSpan.kt
230230
+++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactBackgroundDrawSpan.kt
231231
@@ -14,11 +14,15 @@ import android.text.Layout
@@ -284,37 +284,16 @@ index 326b049..48f6592 100644
284284

285285
override fun onPreDraw(start: Int, end: Int, canvas: Canvas, layout: Layout) {
286286
if (start >= end) return
287-
@@ -48,70 +69,132 @@ internal class ReactBackgroundDrawSpan(
288-
val lineStart = layout.getLineStart(line)
289-
val lineEnd = layout.getLineEnd(line)
290-
291-
- // When the span starts at or before this line, use the line's left edge.
292-
- // Otherwise use the actual character position of the span start.
287+
@@ -52,7 +73,7 @@ internal class ReactBackgroundDrawSpan(
288+
// Otherwise use the actual character position of the span start.
293289
val left =
294-
- if (start <= lineStart) {
290+
if (start <= lineStart) {
295291
- layout.getLineLeft(line)
296-
- } else {
297-
- layout.getPrimaryHorizontal(start)
298-
- }
299-
-
300-
- // When the span extends past this line, use the line's right edge.
301-
- // getLineEnd() returns the offset of the first char on the NEXT line for
302-
- // soft-wrapped lines, so getPrimaryHorizontal(lineEnd) would incorrectly
303-
- // give us the left margin of the next line instead of the right edge.
304-
+ if (start <= lineStart) layout.getLineLeft(line)
305-
+ else layout.getPrimaryHorizontal(start)
306-
+
307-
val right =
308-
- if (end >= lineEnd) {
309-
- layout.getLineRight(line)
310-
- } else {
311-
- layout.getPrimaryHorizontal(end)
312-
- }
313-
+ if (end >= lineEnd) layout.getLineRight(line)
314-
+ else layout.getPrimaryHorizontal(end)
315-
316-
val baseline = layout.getLineBaseline(line).toFloat()
317-
val fm = layout.paint.fontMetrics
292+
+ layout.getPrimaryHorizontal(lineStart)
293+
} else {
294+
layout.getPrimaryHorizontal(start)
295+
}
296+
@@ -73,45 +94,119 @@ internal class ReactBackgroundDrawSpan(
318297
val top = baseline + fm.ascent
319298
val bottom = baseline + fm.descent
320299

@@ -463,7 +442,7 @@ index 326b049..48f6592 100644
463442
}
464443
}
465444
diff --git a/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp b/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp
466-
index 6eb899f..eb0d85b 100644
445+
index 6eb899f38a9..eb0d85b4b69 100644
467446
--- a/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp
468447
+++ b/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp
469448
@@ -42,6 +42,36 @@ void TextAttributes::apply(TextAttributes textAttributes) {
@@ -581,7 +560,7 @@ index 6eb899f..eb0d85b 100644
581560
// Font
582561
debugStringConvertibleItem(
583562
diff --git a/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h b/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h
584-
index 2eaa3bc..af278a3 100644
563+
index 2eaa3bc26f3..af278a3921a 100644
585564
--- a/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h
586565
+++ b/node_modules/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h
587566
@@ -47,6 +47,16 @@ class TextAttributes : public DebugStringConvertible {
@@ -621,7 +600,7 @@ index 2eaa3bc..af278a3 100644
621600
};
622601
} // namespace std
623602
diff --git a/node_modules/react-native/ReactCommon/react/renderer/attributedstring/conversions.h b/node_modules/react-native/ReactCommon/react/renderer/attributedstring/conversions.h
624-
index 48c1fe2..3f7b481 100644
603+
index 48c1fe23ae2..3f7b4818f9e 100644
625604
--- a/node_modules/react-native/ReactCommon/react/renderer/attributedstring/conversions.h
626605
+++ b/node_modules/react-native/ReactCommon/react/renderer/attributedstring/conversions.h
627606
@@ -1031,6 +1031,14 @@ constexpr static MapBuffer::Key TA_KEY_BORDER_TOP_LEFT_RADIUS = 30;
@@ -690,7 +669,7 @@ index 48c1fe2..3f7b481 100644
690669
}
691670

692671
diff --git a/node_modules/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp b/node_modules/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp
693-
index 44ef461..b9ae418 100644
672+
index 44ef4619b05..b9ae418a0fa 100644
694673
--- a/node_modules/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp
695674
+++ b/node_modules/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp
696675
@@ -252,6 +252,66 @@ static TextAttributes convertRawProp(
@@ -861,7 +840,7 @@ index 44ef461..b9ae418 100644
861840

862841
#endif
863842
diff --git a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm
864-
index 3bec610..ed7ee76 100644
843+
index 3bec61013b8..ed7ee76ce6a 100644
865844
--- a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm
866845
+++ b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm
867846
@@ -184,19 +184,52 @@ NSMutableDictionary<NSAttributedStringKey, id> *RCTNSTextAttributesFromTextAttri
@@ -929,7 +908,7 @@ index 3bec610..ed7ee76 100644
929908
} else {
930909
attributes[NSBackgroundColorAttributeName] = bgColor;
931910
diff --git a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManagerWithBorderRadius.mm b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManagerWithBorderRadius.mm
932-
index fd401a9..3ae5c60 100644
911+
index de879555fcf..c2320fe9792 100644
933912
--- a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManagerWithBorderRadius.mm
934913
+++ b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManagerWithBorderRadius.mm
935914
@@ -26,13 +26,32 @@
@@ -979,15 +958,15 @@ index fd401a9..3ae5c60 100644
979958

980959
__block NSUInteger lineIdx = 0;
981960
[self enumerateLineFragmentsForGlyphRange:spanGlyphRange
982-
@@ -76,6 +94,7 @@
961+
@@ -92,6 +110,7 @@
983962
BOOL isFirst = (lineIdx == 0);
984963
BOOL isLast = (lineIdx == totalLines - 1);
985964

986965
+ // Left/right corners follow the same rule as fill: left on first line, right on last.
987966
CGFloat effectiveTL = isFirst ? tl : 0;
988967
CGFloat effectiveBL = isFirst ? bl : 0;
989968
CGFloat effectiveTR = isLast ? tr : 0;
990-
@@ -86,24 +105,97 @@
969+
@@ -102,24 +121,97 @@
991970
CGFloat w = CGRectGetWidth(spanRect);
992971
CGFloat h = CGRectGetHeight(spanRect);
993972

0 commit comments

Comments
 (0)