From 008982d7318bcd3cd346b6be82bd6527049ca677 Mon Sep 17 00:00:00 2001 From: Charles Powell Date: Fri, 16 May 2014 17:54:28 -0700 Subject: [PATCH] Fix double-drawing on IB-created instances. --- MarqueeLabel.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MarqueeLabel.m b/MarqueeLabel.m index 0b93f0a3..6577fbc0 100755 --- a/MarqueeLabel.m +++ b/MarqueeLabel.m @@ -140,7 +140,7 @@ - (id)initWithFrame:(CGRect)frame rate:(CGFloat)pixelsPerSec andFadeLength:(CGFl } - (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder: aDecoder]; + self = [super initWithCoder:aDecoder]; if (self) { [self setupLabel]; @@ -165,6 +165,10 @@ - (void)forwardPropertiesToSubLabel { [self.subLabel setValue:val forKey:property]; } [self setText:[super text]]; + + // Clear super text, in the case of IB-created labels, to prevent double-drawing + [super setText:nil]; + [self setFont:[super font]]; }