Skip to content

Issues with rolling a timeline backwards with non-animating functions #1316

@NCarson

Description

@NCarson

I have been trying to roll a timeline backwards with
non-animating functions included. and I have
been having trouble figuring out what event to listen to.
Examining the code the start, step, and finish events
fire going forwards but only step fires going backwards.

My use case is to attach a filter to an element. I do not
think there is any way to animate that nativly. But since
it is part of the animation, I need to have it queued in the timeline.

Anyways I found a way to do it with the during function:

draw.animate(1, at+duration, 'absolute')
    .during( (progress) => {
        let name = (progress == 1) ? 'none' : 'url(#motion-blur)'
        draw.attr({filter:name})
    })

Since the duration is 1, the function will only run once per animation cycle.
The progress will be either 0 on 1 depending on the direction
the timeline is going in.

I am not sure I call this a bug, but it seems to be under-documented.
I think it would be nice to list the arguments that runner methods
will provide in the callback, as to get more of idea of what they do.
Also, what kind of events are fired does not seem to be listed in the doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions