@@ -189,32 +189,23 @@ - (void)drawRect:(CGRect)rect {
189
189
// ----- Animate Drawing -----//
190
190
// ---------------------------//
191
191
if (self.animationTime == 0 ) {
192
- [self .color set ];
193
-
194
- [line setLineWidth: self .lineWidth];
195
- [line strokeWithBlendMode: kCGBlendModeNormal alpha: self .lineAlpha];
196
-
197
192
if (self.enableRefrenceLines == YES ) {
198
193
[referenceLinesPath setLineWidth: self .lineWidth/2 ];
199
194
200
195
if (self.refrenceLineColor ) {
201
196
[self .refrenceLineColor set ];
197
+ } else {
198
+ [self .color set ];
202
199
}
203
200
204
201
[referenceLinesPath strokeWithBlendMode: kCGBlendModeNormal alpha: self .lineAlpha/2 ];
205
202
}
206
- } else {
207
- CAShapeLayer *pathLayer = [CAShapeLayer layer ];
208
- pathLayer.frame = self.bounds ;
209
- pathLayer.path = line.CGPath ;
210
- pathLayer.strokeColor = self.color .CGColor ;
211
- pathLayer.fillColor = nil ;
212
- pathLayer.lineWidth = self.lineWidth ;
213
- pathLayer.lineJoin = kCALineJoinBevel ;
214
- pathLayer.lineCap = kCALineCapRound ;
215
- [self animateForLayer: pathLayer withAnimationType: self .animationType isAnimatingReferenceLine: NO ];
216
- [self .layer addSublayer: pathLayer];
217
203
204
+ [self .color set ];
205
+ [line setLineWidth: self .lineWidth];
206
+ [line strokeWithBlendMode: kCGBlendModeNormal alpha: self .lineAlpha];
207
+
208
+ } else {
218
209
if (self.enableRefrenceLines == YES ) {
219
210
CAShapeLayer *referenceLinesPathLayer = [CAShapeLayer layer ];
220
211
referenceLinesPathLayer.frame = self.bounds ;
@@ -232,6 +223,17 @@ - (void)drawRect:(CGRect)rect {
232
223
[self animateForLayer: referenceLinesPathLayer withAnimationType: self .animationType isAnimatingReferenceLine: YES ];
233
224
[self .layer addSublayer: referenceLinesPathLayer];
234
225
}
226
+
227
+ CAShapeLayer *pathLayer = [CAShapeLayer layer ];
228
+ pathLayer.frame = self.bounds ;
229
+ pathLayer.path = line.CGPath ;
230
+ pathLayer.strokeColor = self.color .CGColor ;
231
+ pathLayer.fillColor = nil ;
232
+ pathLayer.lineWidth = self.lineWidth ;
233
+ pathLayer.lineJoin = kCALineJoinBevel ;
234
+ pathLayer.lineCap = kCALineCapRound ;
235
+ [self animateForLayer: pathLayer withAnimationType: self .animationType isAnimatingReferenceLine: NO ];
236
+ [self .layer addSublayer: pathLayer];
235
237
}
236
238
}
237
239
0 commit comments