Permalink
Browse files

Replacing kAboutWindowCreditsAnimationDuration with kAboutWindowCredi…

…tsAnimationSpeed.

This allows for all localizations to have the same scrolling speed, regardless off text length.
  • Loading branch information...
1 parent 49896cc commit 75369d53ecb296fcfe7fbfbea825b8c46bd049ca Jan Weiß committed Jun 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 ScrollingAboutWindow/AboutWindowController.m
@@ -9,7 +9,7 @@
#import <QuartzCore/QuartzCore.h>
#import "AboutWindowController.h"
-static CGFloat kAboutWindowCreditsAnimationDuration = 30.0;
+static CGFloat kAboutWindowCreditsAnimationSpeed = 2.0; // Points per second
static CGFloat kAboutWindowCreditsFadeHeight = 6.0;
static CGColorRef kAboutWindowCreditsFadeColor1 = NULL;
static CGColorRef kAboutWindowCreditsFadeColor2 = NULL;
@@ -136,7 +136,7 @@ - (void)startCreditsScrollAnimation {
// Animate to top and execute animation again - resulting in endless loop.
[CATransaction begin];
- [CATransaction setAnimationDuration:kAboutWindowCreditsAnimationDuration];
+ [CATransaction setAnimationDuration:(viewHeight / kAboutWindowCreditsAnimationSpeed)];
[CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
[CATransaction setCompletionBlock:^{
if (!self.isCreditsAnimationActive) return;

0 comments on commit 75369d5

Please sign in to comment.