Re: CAShapeLayer curved path animation
Re: CAShapeLayer curved path animation
- Subject: Re: CAShapeLayer curved path animation
- From: David Duncan <email@hidden>
- Date: Sat, 6 Nov 2010 18:11:17 -0700
On Nov 6, 2010, at 4:41 PM, Gideon King wrote:
> I'm using a CAShapeLayer, and the animation of the shape of the curved path I am using is doing really strange things (It seems to work fine on straight lines). I have tried:
>
> CGPathMoveToPoint(tempPath, NULL, startPoint.x, startPoint.y);
> CGPathAddQuadCurveToPoint(tempPath, NULL, ctrl1.x, ctrl1.y, midPoint.x, midPoint.y);
> CGPathAddQuadCurveToPoint(tempPath, NULL, ctrl2.x, ctrl2.y, endPoint.x, endPoint.y);
>
> and:
>
> CGPathMoveToPoint(tempPath, NULL, startPoint.x, startPoint.y);
> CGPathAddCurveToPoint(tempPath, NULL, ctrl1.x, ctrl1.y, ctrl1.x, ctrl1.y, midPoint.x, midPoint.y);
> CGPathAddCurveToPoint(tempPath, NULL, ctrl2.x, ctrl2.y, ctrl2.x, ctrl2.y, endPoint.x, endPoint.y);
These two paths are not structurally equivalent is the problem. You should be able to get something predictable by using AddCurveToPoint in both places, and to use the same location for both control points (which degenerates a Cubic curve to a Quadratic one).
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden