File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,20 @@ - (void)drawMentions {
8282 CGFloat width = endLocation.x - startLocation.x ;
8383 CGFloat x = lineBounds.origin .x + startLocation.x ;
8484
85+ NSUInteger lineRelativeLocation = intersection.location - lineFragment.characterRange .location ;
86+ UIFont *font = [lineFragment.attributedString attribute: NSFontAttributeName
87+ atIndex: lineRelativeLocation
88+ effectiveRange: NULL ];
89+ CGFloat ascent = font.ascender ;
90+ CGFloat descent = font.descender ;
91+ CGFloat textHeight = ascent - descent;
92+ CGFloat y = (startLocation.y - ascent) / 2 ;
93+
94+
8595 CGRect backgroundRect = CGRectMake (x,
86- lineBounds. origin . y ,
96+ y,
8797 width,
88- lineBounds. size . height );
98+ textHeight );
8999
90100 BOOL isStart = (intersection.location == mention.range .location );
91101 BOOL isEnd = (NSMaxRange (intersection) == NSMaxRange (mention.range ));
You can’t perform that action at this time.
0 commit comments