Skip to content

Commit

Permalink
Take edge insets into account when computing size.
Browse files Browse the repository at this point in the history
  • Loading branch information
schwa committed Oct 28, 2011
1 parent ebdcd14 commit 284ebe1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/CCoreTextLabel.m
Expand Up @@ -237,7 +237,15 @@ - (CCoreTextRenderer *)renderer

- (CGSize)sizeThatFits:(CGSize)size
{
return([self.renderer sizeThatFits:size]);
CGSize theSize = size;
theSize.width -= self.insets.left + self.insets.right;
theSize.height -= self.insets.top + self.insets.bottom;

theSize = [self.renderer sizeThatFits:theSize];
theSize.width += self.insets.left + self.insets.right;
theSize.height += self.insets.top + self.insets.bottom;

return(theSize);
}

- (void)drawRect:(CGRect)rect
Expand Down

0 comments on commit 284ebe1

Please sign in to comment.