Skip to content
Closed
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
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -411,7 +411,6 @@ static void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText)

[nsAttributedString appendAttributedString:nsAttributedStringFragment];
}
RCTApplyBaselineOffset(nsAttributedString);
[nsAttributedString endEditing];

return nsAttributedString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ - (NSTextStorage *)_textStorageAndLayoutManagerWithAttributesString:(NSAttribute

NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:attributedString];

RCTApplyBaselineOffset(textStorage);

[textStorage addLayoutManager:layoutManager];

if (paragraphAttributes.adjustsFontSizeToFit) {
Expand Down