Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect math #1

Open
H2CO3 opened this issue Nov 2, 2011 · 0 comments
Open

Incorrect math #1

H2CO3 opened this issue Nov 2, 2011 · 0 comments

Comments

@H2CO3
Copy link

H2CO3 commented Nov 2, 2011

On line 176 in SlideToCancelViewController.m, it reads:


- (void) sliderChanged: (UISlider *) sender
{
    // Fade the text as the slider moves to the right. This code makes the
    // text totally dissapear when the slider is 35% of the way to the right.
    label.alpha = MAX(0.0, 1.0 - (slider.value * 3.5));

    // Stop the animation if the slider moved off the zero point
    if (slider.value != 0) {
        [self stopTimer];
        [label.layer setNeedsDisplay];
    }
}

Lines 178-180:

// Fade the text as the slider moves to the right. This code makes the
// text totally dissapear when the slider is 35% of the way to the right.
label.alpha = MAX(0.0, 1.0 - (slider.value * 3.5));

It's not true. It makes the text disappear when it reaches 1/3.5 which is approx. 28.6 %. The corrected line 180 would be:

label.alpha = MAX(0.0, 1.0 - (slider.value / 0.35));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant