Skip to content

Commit

Permalink
Merge pull request #697 from DanielMaly/master
Browse files Browse the repository at this point in the history
Changed DTAttributedTextContentView to discard invalid CGContexts.
  • Loading branch information
odrobnik committed Jan 6, 2014
2 parents a34d9eb + d98863e commit b07c6ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/Source/DTAttributedTextContentView.m
Expand Up @@ -1020,6 +1020,10 @@ - (UIImage *)contentImageWithBounds:(CGRect)bounds options:(DTCoreTextLayoutFram

CGContextRef context = UIGraphicsGetCurrentContext();

if(!context) {
return nil;
}

CGContextTranslateCTM(context, -bounds.origin.x, -bounds.origin.y);

[self.layoutFrame drawInContext:context options:options];
Expand Down

0 comments on commit b07c6ea

Please sign in to comment.