From 15fc6fa9a52c553e9eea2ad05cb93bcf75d6c4dc Mon Sep 17 00:00:00 2001 From: Nicholas Tau Date: Tue, 30 Dec 2014 14:46:31 +0800 Subject: [PATCH] typo here. still keep `pointerStockColor` property, but deprecated. --- Pod/Classes/EUMShowTouchWindow.h | 3 ++- Pod/Classes/EUMShowTouchWindow.m | 12 +++++++++++- Pod/Classes/EUMTouchPointView.h | 3 ++- Pod/Classes/EUMTouchPointView.m | 18 ++++++++++++++---- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Pod/Classes/EUMShowTouchWindow.h b/Pod/Classes/EUMShowTouchWindow.h index 8132479..2118e03 100644 --- a/Pod/Classes/EUMShowTouchWindow.h +++ b/Pod/Classes/EUMShowTouchWindow.h @@ -13,6 +13,7 @@ @property(nonatomic,strong) UIImage *imgViewPointer; @property(nonatomic,assign) CGSize pointerSize; @property(nonatomic,strong) UIColor *pointerColor; -@property(nonatomic,strong) UIColor *pointerStockColor; +@property(nonatomic,strong) UIColor *pointerStockColor NS_DEPRECATED_IOS(2_0,3_0, "typo here"); +@property(nonatomic,strong) UIColor *pointerStrokeColor; @end diff --git a/Pod/Classes/EUMShowTouchWindow.m b/Pod/Classes/EUMShowTouchWindow.m index 755d729..2cfedf2 100644 --- a/Pod/Classes/EUMShowTouchWindow.m +++ b/Pod/Classes/EUMShowTouchWindow.m @@ -31,6 +31,16 @@ -(CGSize)pointerSize{ return _pointerSize; } +-(void)setPointerStockColor:(UIColor *)pointerStockColor +{ + self.pointerStrokeColor = pointerStockColor; +} + +-(UIColor*)pointerStockColor +{ + return _pointerStrokeColor; +} + - (void)sendEvent:(UIEvent *)event { [super sendEvent:event]; @@ -45,7 +55,7 @@ - (void)sendEvent:(UIEvent *)event EUMTouchPointView *touchPointerView = [[EUMTouchPointView alloc] initWithFrame:CGRectMake(point.x-self.pointerSize.width/2 ,point.y-self.pointerSize.height/2, self.pointerSize.width, self.pointerSize.height)]; touchPointerView.contentMode = UIViewContentModeRedraw; touchPointerView.pointerColor = self.pointerColor; - touchPointerView.pointerStockColor = self.pointerStockColor; + touchPointerView.pointerStrokeColor = self.pointerStrokeColor; [self addSubview:touchPointerView]; touch.viewTouchPointer = touchPointerView; touchPointerView.transform = CGAffineTransformMakeScale(kStartScale, kStartScale); diff --git a/Pod/Classes/EUMTouchPointView.h b/Pod/Classes/EUMTouchPointView.h index 50c6da9..bd664ba 100644 --- a/Pod/Classes/EUMTouchPointView.h +++ b/Pod/Classes/EUMTouchPointView.h @@ -11,5 +11,6 @@ @interface EUMTouchPointView : UIView @property(nonatomic,strong) UIColor *pointerColor; -@property(nonatomic,strong) UIColor *pointerStockColor; +@property(nonatomic,strong) UIColor *pointerStockColor NS_DEPRECATED_IOS(2_0,3_0, "typo here"); +@property(nonatomic,strong) UIColor *pointerStrokeColor; @end diff --git a/Pod/Classes/EUMTouchPointView.m b/Pod/Classes/EUMTouchPointView.m index 8138c07..96ca4f0 100644 --- a/Pod/Classes/EUMTouchPointView.m +++ b/Pod/Classes/EUMTouchPointView.m @@ -22,11 +22,21 @@ -(instancetype)initWithFrame:(CGRect)frame{ -(void)drawRect:(CGRect)rect{ CGRect frm = self.frame; - [self drawPointer:frm.size stockWidth:3]; + [self drawPointer:frm.size strokeWidth:3]; } -- (void)drawPointer: (CGSize)pointSize stockWidth: (CGFloat)stockWidth +-(void)setPointerStockColor:(UIColor *)pointerStockColor +{ + self.pointerStrokeColor = pointerStockColor; +} + +-(UIColor*)pointerStockColor +{ + return _pointerStrokeColor; +} + +- (void)drawPointer: (CGSize)pointSize strokeWidth: (CGFloat)stockWidth { //// General Declarations @@ -50,8 +60,8 @@ - (void)drawPointer: (CGSize)pointSize stockWidth: (CGFloat)stockWidth CGContextSaveGState(context); CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, [shadow CGColor]); - if (self.pointerStockColor) { - [self.pointerStockColor setStroke]; + if (self.pointerStrokeColor) { + [self.pointerStrokeColor setStroke]; }else{ [UIColor.whiteColor setStroke]; }