Skip to content

Certain easing functions appear to never fully complete #45

@harryr0se

Description

@harryr0se

Heya 👋

I've noticed that for some easing functions the value passed to to() is never reached, I'm not sure if this is on purpose or not but I didn't see it mentioned in the docs (I might have missed it)

I wrote the following loop to test

for (int i = 1; i <= 32; ++i)
{
    auto easing = static_cast<tweeny::easing::enumerated>(i);
    int expectedEnd = -369;
    auto tween = tweeny::from(0).to(expectedEnd).during(500).via(easing);
    tween.seek(1.0f);
    auto actualEnd = tween.step(1);
    if (actualEnd != expectedEnd)
        printf("Easing %s: never reached expected value %i, finished at %i\n", toString(easing), expectedEnd, actualEnd);
}

Which found the following easing values to have this behaviour

Easing stepped: never reached expected value -369, finished at 0
Easing quadraticInOut: never reached expected value -369, finished at -368
Easing cubicInOut: never reached expected value -369, finished at -368
Easing quarticInOut: never reached expected value -369, finished at -368
Easing quinticInOut: never reached expected value -369, finished at -368
Easing sinusoidalInOut: never reached expected value -369, finished at -368
Easing exponentialOut: never reached expected value -369, finished at -368
Easing exponentialInOut: never reached expected value -369, finished at -367
Easing circularInOut: never reached expected value -369, finished at -368
Easing backInOut: never reached expected value -369, finished at -368

Do you know it this is expected behaviour?

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