ΩlostA
ΩlostA

Reputation: 2601

iOS: Problem with my drawing popover that doesn't display well since iOS13

I display a popover that's allows to draw inside.

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    mouseSwiped = NO;
    UITouch *touch = [touches anyObject];
    lastPoint = [touch locationInView:self.view];
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    mouseSwiped = YES;
    UITouch *touch = [touches anyObject];
    CGPoint currentPoint = [touch locationInView:self.view];

     NSLog(@"lastPoint: %@", NSStringFromCGPoint(lastPoint));

    UIGraphicsBeginImageContext(self.view.frame.size);
    [mainImage.image drawInRect:CGRectMake(0, 0, 600, 400)];
    CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
    CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
    CGContextSetLineWidth(UIGraphicsGetCurrentContext(), brush );
    CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), red, green, blue, 1.0);
    CGContextSetBlendMode(UIGraphicsGetCurrentContext(),kCGBlendModeNormal);

    CGContextStrokePath(UIGraphicsGetCurrentContext());
    mainImage.image = UIGraphicsGetImageFromCurrentImageContext();
    [mainImage setAlpha:opacity];
    UIGraphicsEndImageContext();

    lastPoint = currentPoint;
}

My problem is that since the iOS13, it doesn't display well.

How it should display:
enter image description here

How it display now in iOS13:
enter image description here

Any ideas?

Upvotes: 0

Views: 83

Answers (0)

Related Questions