adamwulf / ClippingBezier

ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
http://getlooseleaf.com/opensource/
MIT License
254 stars 34 forks source link

boundsForElement function is missing kCGPathElementAddQuadCurveToPoint type #36

Closed cjycsm closed 6 months ago

cjycsm commented 6 months ago

Here are two paths:

UIBezierPath *path1 = [UIBezierPath bezierPath];
[path1 moveToPoint:CGPointMake(0, 0)];
[path1 addLineToPoint:CGPointMake(200, 95)];
UIBezierPath *path2 = [UIBezierPath bezierPath];
[path2 moveToPoint:CGPointMake(100, 100)];
[path2 addQuadCurveToPoint:CGPointMake(200, 90) controlPoint:CGPointMake(150, 250)];

Current codes can't find intersections of these two paths.

截屏2024-01-02 17 44 59

I found that the reason was that the kCGPathElementAddQuadCurveToPoint type wasn't enumerated in boundsForElement function.

截屏2024-01-02 17 41 37
adamwulf commented 6 months ago

Fixed in #38