Added method CGPathContainsPoint

This commit is contained in:
Alexandre Wilhelm committed 2013-05-24 11:53:33 -07:00
1 parent a79ac2e9e4
commit 25f54c83ed
1 file changed
+18 -2
+18 -2
View File
@@ -610,7 +610,23 @@ function CGPathGetBoundingBox(aPath)
return CGRectMake(ox, oy, rx - ox, ry - oy);
}
function CGPathContainsPoint(aPath, aTransform, point, eoFill)
{
if (!aPath.count)
return NO;
if (aTransform)
point = CGPointApplyAffineTransform(point, aTransform);
var context = CGBitmapGraphicsContextCreate();
CGContextBeginPath(context);
CGContextAddPath(context, aPath);
CGContextClosePath(context);
return context.isPointInPath(point.x, point.y);
}
/*!
@}
*/
*/