-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43902 from software-mansion-labs/@jpiasecki/fix-c…
…lipped-emojis Restore default line height to 20
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
diff --git a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h | ||
index 49a4353..c0158f3 100644 | ||
--- a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h | ||
+++ b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h | ||
@@ -39,6 +39,8 @@ facebook::react::AttributedStringBox RCTAttributedStringBoxFromNSAttributedStrin | ||
|
||
NSString *RCTNSStringFromStringApplyingTextTransform(NSString *string, facebook::react::TextTransform textTransform); | ||
|
||
+void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText); | ||
+ | ||
@interface RCTWeakEventEmitterWrapper : NSObject | ||
@property (nonatomic, assign) facebook::react::SharedEventEmitter eventEmitter; | ||
@end | ||
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 | ||
index b3b53c8..b2d43c6 100644 | ||
--- 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 | ||
@@ -300,7 +300,7 @@ inline static CGFloat RCTEffectiveFontSizeMultiplierFromTextAttributes(const Tex | ||
return [attributes copy]; | ||
} | ||
|
||
-static void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText) | ||
+void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText) | ||
{ | ||
__block CGFloat maximumLineHeight = 0; | ||
|
||
@@ -396,7 +396,6 @@ static void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText) | ||
|
||
[nsAttributedString appendAttributedString:nsAttributedStringFragment]; | ||
} | ||
- RCTApplyBaselineOffset(nsAttributedString); | ||
[nsAttributedString endEditing]; | ||
|
||
return nsAttributedString; | ||
diff --git a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm | ||
index 368c334..1f06f92 100644 | ||
--- a/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm | ||
+++ b/node_modules/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm | ||
@@ -261,7 +261,7 @@ - (NSTextStorage *)_textStorageForNSAttributesString:(NSAttributedString *)attri | ||
[layoutManager addTextContainer:textContainer]; | ||
|
||
NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:attributedString]; | ||
- | ||
+ RCTApplyBaselineOffset(textStorage); | ||
[textStorage addLayoutManager:layoutManager]; | ||
|
||
if (paragraphAttributes.adjustsFontSizeToFit) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters