#175 ✓resolved
Alex J

CPAnimation setAnimationCurve: Rejects CPAnimationLinear

Reported by Alex J | December 21st, 2008 @ 08:21 PM | in 0.6.5

Cappuccino version 0.6 (and possibly others). CPAnimation.j: 117 - 137:

There is a switch statement on line 123 that is designed to raise an Illegal Argument Exception if the animation curve is not one of the known constants. However, there is no case for CPAnimationLinear, so calling [myAnim setAnimationCurve: CPAnimationLinear] raises an exception, even thought that is a valid curve.

Comments and changes to this ticket

  • Alex J

    Alex J December 21st, 2008 @ 08:23 PM

    • Title changed from “CPAnimation setAnimationCurve: can assign invalid animationCurve” to “CPAnimation setAnimationCurve: Rejects CPAnimationLinear”
  • Alex J

    Alex J December 22nd, 2008 @ 07:53 AM

    Here's a modified version of setAnimationCurve: that resolves #175 and #176:

    - (void)setAnimationCurve:(CPAnimationCurve)anAnimationCurve
        var timingFunctionName;
        switch (anAnimationCurve)
            case CPAnimationEaseInOut:  timingFunctionName = kCAMediaTimingFunctionEaseInEaseOut;
            case CPAnimationEaseIn:     timingFunctionName = kCAMediaTimingFunctionEaseIn;
            case CPAnimationEaseOut:    timingFunctionName = kCAMediaTimingFunctionEaseOut;
            case CPAnimationLinear:     timingFunctionName = kCAMediaTimingFunctionLinear;
            default:                    [CPException raise:CPInvalidArgumentException
                                                    reason:"Invalid value provided for animation curve"];
        _animationCurve = anAnimationCurve;
        _timingFunction = [CAMediaTimingFunction functionWithName:timingFunctionName];
  • Francisco Tolmasky

    Francisco Tolmasky December 22nd, 2008 @ 02:36 PM

    • Milestone set to 0.6.5
    • Assigned user set to “Francisco Tolmasky”

    yeah all this looks good to me

  • admin (at 280north)

    admin (at 280north) December 22nd, 2008 @ 02:38 PM

    • State changed from “new” to “resolved”

    (from [08a3b644838f313edbfb919f6fdc864824194451]) Fix for impropert animationCurve being set.

    [#175 state:resolved]. [#176 state:resolved].

    Reviewed by me. http://github.com/280north/cappu...

  • Francisco Tolmasky

    Francisco Tolmasky December 22nd, 2008 @ 02:38 PM

    K, its in, I don't have your email/info so I couldn't put you as the author though. If you send it to me I can go ahead and change the commit log.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.

Shared Ticket Bins

People watching this ticket

Referenced by