domhofmann / PRTween

Lightweight tween library for iOS
BSD 2-Clause "Simplified" License
459 stars 63 forks source link

Recursive bug with PRTweenCGRectLerp::lerp method #18

Closed rbrisita closed 12 years ago

rbrisita commented 12 years ago

Lines 181 - 185 in PRTween.m

This method calls itself and does not pass along the given timeingFunction too:

#if NS_BLOCKS_AVAILABLE
+ (PRTweenOperation *)lerp:(id)object property:(NSString *)property from:(CGRect)from to:(CGRect)to duration:    (CGFloat)duration timingFunction:(PRTweenTimingFunction)timingFunction updateBlock:    (PRTweenUpdateBlock)updateBlock completeBlock:(PRTweenCompleteBlock)completeBlock { 
    return [PRTweenCGRectLerp lerp:object property:property from:from to:to duration:duration timingFunction:NULL     updateBlock:updateBlock completeBlock:completeBlock];
}
#endif

It should be:

#if NS_BLOCKS_AVAILABLE
+ (PRTweenOperation *)lerp:(id)object 
                                    property:(NSString *)property
                                            from:(CGRect)from
                                                to:(CGRect)to
                                    duration:(CGFloat)duration
                        timingFunction:(PRTweenTimingFunction)timingFunction
                             updateBlock:(PRTweenUpdateBlock)updateBlock
                         completeBlock:(PRTweenCompleteBlock)completeBlock
{ 
    PRTweenCGRectLerpPeriod *period = [PRTweenCGRectLerpPeriod periodWithStartCGRect:from endCGRect:to duration:duration];
    return [PRTween lerp:object 
                            property:property 
                                period:period 
                timingFunction:timingFunction 
                     updateBlock:updateBlock 
                 completeBlock:completeBlock];
}
#endif