Commit 5d5c3dfc authored by huanglu's avatar huanglu

update

parent 558a0b6f
......@@ -110,7 +110,6 @@ NSString *const kLFDrawViewData = @"LFDrawViewData";
CGPoint point = [touch locationInView:self];
//设置线宽
path.lineWidth = 4.0f;
path.lineCapStyle = kCGLineCapRound; //线条拐角
path.lineJoinStyle = kCGLineJoinRound; //终点处理
[path moveToPoint:point];
......@@ -187,37 +186,37 @@ NSString *const kLFDrawViewData = @"LFDrawViewData";
[self setNeedsDisplay];
}
//-(void)drawRect:(CGRect)rect{
//
// if (self.lineArray.count) {
// for (LFDrawBezierPath *path in self.lineArray) {
// if (path.isErase) {
//
// [self.backgroundColor setStroke];
//
// }else{
// [path.color setStroke];
// }
//
//
// path.lineCapStyle = kCGLineCapRound;
// path.lineJoinStyle = kCGLineCapRound;
// if (path.isErase) {
// path.lineWidth = 10; // 这里可抽取出来枚举定义
// [path strokeWithBlendMode:kCGBlendModeDestinationIn alpha:1.0];
// }else{
// path.lineWidth = 3;
// [path strokeWithBlendMode:kCGBlendModeNormal alpha:1.0];
// }
// [path stroke];
//
// }
//
// }
//
//
// [super drawRect:rect];
//}
-(void)drawRect:(CGRect)rect{
if (self.lineArray.count) {
for (LFDrawBezierPath *path in self.lineArray) {
if (path.isErase) {
[self.backgroundColor setStroke];
}else{
[path.color setStroke];
}
path.lineCapStyle = kCGLineCapRound;
path.lineJoinStyle = kCGLineCapRound;
if (path.isErase) {
path.lineWidth = 10; // 这里可抽取出来枚举定义
[path strokeWithBlendMode:kCGBlendModeDestinationIn alpha:1.0];
}else{
path.lineWidth = 4.0f;
[path strokeWithBlendMode:kCGBlendModeNormal alpha:1.0];
}
[path stroke];
}
}
[super drawRect:rect];
}
//- (void)drawRect:(CGRect)rect{
// //遍历数组,绘制曲线
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment