Skip to content

Commit

Permalink
added offsetForStringIndex method on line
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Aug 2, 2011
1 parent 37646cc commit d729aff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/DTCoreTextLayoutLine.h
Expand Up @@ -39,9 +39,10 @@
- (NSArray *)glyphRunsWithRange:(NSRange)range;
- (CGRect)frameOfGlyphsWithRange:(NSRange)range;
- (CGRect)imageBoundsInContext:(CGContextRef)context;
- (NSArray *)stringIndices;
- (CGFloat)offsetForStringIndex:(NSInteger)index;

- (void)drawInContext:(CGContextRef)context;
- (NSArray *)stringIndices;

- (BOOL)correctAttachmentHeights:(CGFloat *)downShift;

Expand Down
5 changes: 5 additions & 0 deletions Classes/DTCoreTextLayoutLine.m
Expand Up @@ -175,6 +175,11 @@ - (CGRect)imageBoundsInContext:(CGContextRef)context
return CTLineGetImageBounds(_line, context);
}

- (CGFloat)offsetForStringIndex:(NSInteger)index
{
return CTLineGetOffsetForStringIndex(_line, index, NULL);
}

- (void)drawInContext:(CGContextRef)context
{
CTLineDraw(_line, context);
Expand Down

0 comments on commit d729aff

Please sign in to comment.