From 2ee9757da0f72f294a4b7d2b4c7c71b418aac64e Mon Sep 17 00:00:00 2001 From: Charles Powell Date: Sat, 26 Mar 2016 13:56:57 -0700 Subject: [PATCH] Draw only background color to layer, fixes black at label edges with non-clear background color. --- MarqueeLabel.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MarqueeLabel.m b/MarqueeLabel.m index f23d7d24..b1152e87 100755 --- a/MarqueeLabel.m +++ b/MarqueeLabel.m @@ -168,6 +168,10 @@ - (CAReplicatorLayer *)repliLayer { - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx { // Do NOT call super, to prevent UILabel superclass from drawing into context // Label drawing is handled by sublabel and CAReplicatorLayer layer class + + // Draw only background color + CGContextSetFillColorWithColor(ctx, self.backgroundColor.CGColor); + CGContextFillRect(ctx, layer.bounds); } - (void)forwardPropertiesToSubLabel {