Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPAnimation setAnimationCurve: Rejects CPAnimationLinear

#175

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.

Reported by Alex J · December 21st, 2008 @ 08:21 PM

State: resolved
Milestone: 0.6.5
Assigned to: Francisco Tolmasky Francisco Tolmasky

Activity

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

    December 21st, 2008 @ 08:23 PM

  2. Alex J
    Alex J

    Here's a modified version of setAnimationCurve: that resolves #175 CPAnimation setAnimationCurve: Rejects CPAnimationLinear and #176 CPAnimation setAnimationCurve: Can Assign Invalid _animationCurve:

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

    December 22nd, 2008 @ 07:53 AM

  3. Francisco Tolmasky
    Francisco Tolmasky
    • Milestone set to 0.6.5
    • Assigned user set to Francisco Tolmasky

    yeah all this looks good to me

    December 22nd, 2008 @ 02:36 PM

  4. admin (at 280north)
    admin (at 280north)
    • State changed from new to resolved

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

    [#175 CPAnimation setAnimationCurve: Rejects CPAnimationLinear state:resolved]. [#176 CPAnimation setAnimationCurve: Can Assign Invalid _animationCurve state:resolved].

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

    December 22nd, 2008 @ 02:38 PM

  5. Francisco Tolmasky
    Francisco Tolmasky

    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.

    December 22nd, 2008 @ 02:38 PM

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.