mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-23 00:28:53 +00:00
CPBezierPath appendBezierPathWithArcFromPoint:toPoint:radius: and CGPathAddArcToPoint.
This commit is contained in:
1 parent
fd138cfae7
commit
ca4e034a3b
4 files changed
+25
-3
No files matched your search
@@ -118,6 +118,17 @@ function CGPathAddArc(aPath, aTransform, x, y, aRadius, aStartAngle, anEndAngle,
|
||||
|
||||
function CGPathAddArcToPoint(aPath, aTransform, x1, y1, x2, y2, aRadius)
|
||||
{
|
||||
var p1 = _CGPointMake(x1, y1),
|
||||
p2 = _CGPointMake(x2, y2);
|
||||
|
||||
if (aTransform)
|
||||
{
|
||||
p1 = _CGPointApplyAffineTransform(p1, aTransform);
|
||||
p2 = _CGPointApplyAffineTransform(p2, aTransform);
|
||||
}
|
||||
|
||||
aPath.current = p2;
|
||||
aPath.elements[aPath.count++] = { type:kCGPathElementAddArcToPoint, p1x:p1.x, p1y:p1.y, p2x:p2.x, p2y:p2.y, radius:aRadius };
|
||||
}
|
||||
|
||||
function CGPathAddCurveToPoint(aPath, aTransform, cp1x, cp1y, cp2x, cp2y, x, y)
|
||||
@@ -186,6 +197,12 @@ function CGPathAddPath(aPath, aTransform, anotherPath)
|
||||
element.endAngle, element.isClockwise);
|
||||
break;
|
||||
|
||||
case kCGPathElementAddArcToPoint: CGPathAddArcToPoint(aPath, aTransform,
|
||||
element.p1x, element.p1y,
|
||||
element.p2x, element.p2y,
|
||||
element.radius);
|
||||
break;
|
||||
|
||||
case kCGPathElementAddQuadCurveToPoint: CGPathAddQuadCurveToPoint(aPath, aTransform,
|
||||
element.cpx, element.cpy,
|
||||
element.x, element.y);
|
||||
|
||||
Reference in new issue
Block a user