The unexpected behavior of LineJoinStyle when the lines are 180 degrees in transit

I get a clipped LineJoin in UIBezierPath when one row is returned exactly from the previous row. If I adjust the second row one pixel, LineJoin will behave as expected. Here is the code:

UIBezierPath *path = [UIBezierPath bezierPath]; [path setLineWidth:10.0f]; [path setLineCapStyle:kCGLineCapRound]; [path setLineJoinStyle:kCGLineJoinRound]; [path moveToPoint:CGPointMake(100, 100)]; [path addLineToPoint:CGPointMake(200, 100)]; [path addLineToPoint:CGPointMake(150, 100)]; [path moveToPoint:CGPointMake(100, 120)]; [path addLineToPoint:CGPointMake(200, 120)]; [path addLineToPoint:CGPointMake(150, 121)]; [[UIColor redColor] setStroke]; [path stroke]; 

The following is displayed here:

enter image description here

This is mistake? If not, is there a way for the top LineJoin path to be rounded? (no wet point)

This happened when I made UIBezierPath with "touch-input", and although text was sometimes recorded, it did.

+4
source share
1 answer

This is fixed in iOS 7. The open radar has also been updated.

+3
source

Source: https://habr.com/ru/post/1446569/


All Articles