Skip to content
Open
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 @@ -702,15 +702,12 @@ - (TextMeasurement)_measureTextStorage:(NSTextStorage *)textStorage
CGSize attachmentSize = attachment.bounds.size;
CGRect glyphRect = [layoutManager boundingRectForGlyphRange:range inTextContainer:textContainer];

CGRect frame;
UIFont *font = [[textStorage attributedSubstringFromRange:range] attribute:NSFontAttributeName
atIndex:0
effectiveRange:nil];
frame = {
.origin =
{glyphRect.origin.x,
glyphRect.origin.y + glyphRect.size.height - attachmentSize.height + font.descender},
.size = attachmentSize};
CGRect lineFragmentRect = [layoutManager lineFragmentRectForGlyphAtIndex:attachmentGlyphRange.location
effectiveRange:nil];
CGFloat baseline = lineFragmentRect.origin.y +
[layoutManager locationForGlyphAtIndex:attachmentGlyphRange.location].y;
CGRect frame = {
.origin = {glyphRect.origin.x, baseline - attachmentSize.height}, .size = attachmentSize};

auto rect = facebook::react::Rect{
.origin = facebook::react::Point{.x = frame.origin.x, .y = frame.origin.y},
Expand Down
Loading