From a0dcb84b265de430c30c5b40ed3d9693c4c5e85d Mon Sep 17 00:00:00 2001 From: kris Date: Thu, 17 Jan 2019 10:07:45 +0800 Subject: [PATCH] fix bug --- Sources/ObjC/UBSignatureDrawingViewController.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Sources/ObjC/UBSignatureDrawingViewController.m b/Sources/ObjC/UBSignatureDrawingViewController.m index 47acad2..5036847 100644 --- a/Sources/ObjC/UBSignatureDrawingViewController.m +++ b/Sources/ObjC/UBSignatureDrawingViewController.m @@ -160,9 +160,24 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesMoved:touches withEvent:event]; + //Cancel touch immediately after automatically over the artboard range + CGPoint touchPoint = [self.class _touchPointFromTouches:touches]; + BOOL isContain = [self.view.layer containsPoint:touchPoint]; + if (!isContain) { + [self.view touchesCancelled:touches withEvent:event]; + return; + } + [self _updateModelWithTouches:touches endContinuousLine:NO]; } +- (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event{ + [super touchesEnded:touches withEvent:event]; + + [self.model asyncEndContinuousLine]; + [self _updateViewFromModel]; +} + #pragma mark - Private - (void)_updateModelWithTouches:(NSSet *)touches endContinuousLine:(BOOL)endContinuousLine