Skip to content

Commit

Permalink
Fix emoji clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
j-piasecki committed Jun 13, 2024
1 parent 3cb03cb commit 85805ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
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

0 comments on commit 85805ff

Please sign in to comment.