Skip to content

Incorrect math #1

Description

@H2CO3

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));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions