CGRect instead of self.bounds when drawing text - #138
Conversation
Makes subclassing much easier!
AliSoftware
commented
Apr 15, 2013
Thanks for your contribution, but this modification of yours will probably break the ability to center the text vertically (self.centerVertically)… Did you test this centering case (and with a partial dirtyRect PS : How come would this modification makes subclassing easier? |
ata-n
commented
Apr 20, 2013
Haven't tested that functionality, Good point! I'll let you know if its ok, It allows me to do something like this in the subclass: - (void)drawTextInRect:(CGRect)rect
{
// Draw stuff around the label or something
CGRect newRect = rect;
newRect.size.width = newRect.size.width - 20;
newRect.origin.y = newRect.origin.y + 5;
newRect.size.height = newRect.size.height - 10;
[superdrawTextInRect:newRect];
} |
AliSoftware
commented
Oct 2, 2013
You should not use your Let me know if overrinding the official |
Makes subclassing much easier!