From fcb9b10b4549b632938f838f5db96c745563a9fd Mon Sep 17 00:00:00 2001 From: ata-n Date: Thu, 11 Apr 2013 13:52:04 -0300 Subject: [PATCH] CGRect instead of self.bounds when drawing text Makes subclassing much easier! --- OHAttributedLabel/Source/OHAttributedLabel.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OHAttributedLabel/Source/OHAttributedLabel.m b/OHAttributedLabel/Source/OHAttributedLabel.m index d1ecbc4..f49e949 100755 --- a/OHAttributedLabel/Source/OHAttributedLabel.m +++ b/OHAttributedLabel/Source/OHAttributedLabel.m @@ -552,7 +552,7 @@ - (void)drawTextInRect:(CGRect)aRect { CFAttributedStringRef cfAttrStrWithLinks = (BRIDGE_CAST CFAttributedStringRef)attributedStringToDisplay; CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(cfAttrStrWithLinks); - drawingRect = self.bounds; + drawingRect = aRect; if (self.centerVertically || self.extendBottomToFit) { CGSize sz = CTFramesetterSuggestFrameSizeWithConstraints(framesetter,CFRangeMake(0,0),NULL,CGSizeMake(drawingRect.size.width,CGFLOAT_MAX),NULL);