From 78e3e098d21535001036c315eb4dfa5bab289fad Mon Sep 17 00:00:00 2001 From: Alexander Karpov Date: Tue, 15 Aug 2017 11:18:51 +0300 Subject: [PATCH 1/2] Fixed drawning of checkbox out of bounds. --- Classes/BEMPathManager.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/BEMPathManager.m b/Classes/BEMPathManager.m index ce5ab44..1335b4a 100755 --- a/Classes/BEMPathManager.m +++ b/Classes/BEMPathManager.m @@ -16,13 +16,13 @@ - (UIBezierPath *)pathForBox { UIBezierPath* path; switch (self.boxType) { case BEMBoxTypeSquare: - path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.size, self.size) cornerRadius:self.cornerRadius]; + path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0.0 + (_lineWidth / 2.0), 0.0 + (_lineWidth / 2.0), self.size - _lineWidth, self.size - _lineWidth) cornerRadius:self.cornerRadius]; [path applyTransform:CGAffineTransformRotate(CGAffineTransformIdentity, M_PI * 2.5)]; [path applyTransform:CGAffineTransformMakeTranslation(self.size, 0)]; break; default: { - CGFloat radius = self.size / 2; + CGFloat radius = (self.size / 2.0) - (self.lineWidth / 2.0);; path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.size / 2, self.size / 2) radius: radius startAngle: - M_PI / 4 From 9d6255cf91bb6ff7e0b11db6c8853aec8df526c6 Mon Sep 17 00:00:00 2001 From: Alexander Karpov Date: Wed, 16 Aug 2017 14:24:34 +0300 Subject: [PATCH 2/2] Replaced ivars with self. --- Classes/BEMPathManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/BEMPathManager.m b/Classes/BEMPathManager.m index 1335b4a..1c63be8 100755 --- a/Classes/BEMPathManager.m +++ b/Classes/BEMPathManager.m @@ -16,7 +16,7 @@ - (UIBezierPath *)pathForBox { UIBezierPath* path; switch (self.boxType) { case BEMBoxTypeSquare: - path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0.0 + (_lineWidth / 2.0), 0.0 + (_lineWidth / 2.0), self.size - _lineWidth, self.size - _lineWidth) cornerRadius:self.cornerRadius]; + path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0.0 + (self.lineWidth / 2.0), 0.0 + (self.lineWidth / 2.0), self.size - self.lineWidth, self.size - self.lineWidth) cornerRadius:self.cornerRadius]; [path applyTransform:CGAffineTransformRotate(CGAffineTransformIdentity, M_PI * 2.5)]; [path applyTransform:CGAffineTransformMakeTranslation(self.size, 0)]; break;