mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-02 11:12:58 +00:00
Added method CGPathContainsPoint
This commit is contained in:
1 parent
a79ac2e9e4
commit
25f54c83ed
1 file changed
+18
-2
@@ -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);
|
||||
}
|
||||
|
||||
/*!
|
||||
@}
|
||||
*/
|
||||
|
||||
*/
|
||||
Reference in new issue
Block a user