rough-notation icon indicating copy to clipboard operation
rough-notation copied to clipboard

Add progress parameter

Open pomber opened this issue 5 years ago • 2 comments

Hey, thanks for opensourcing this library. I haven't even tried it yet but I know it will come in handy.

Most of my use cases would use the annotate animation in sync with other (js controlled) animations. For example, using it together with something like Code Surfer.

Is it possible to add a progress parameter somewhere?

For example, annotation.show(0.5) shows the animation at 50%.

pomber avatar May 27 '20 16:05 pomber

Bu default rough-annotation draws 2 iterations (configurable). e.g. for underline, it will go from left to right and then from right to left - to create a scribble effect. This can be removed by setting iterations to 1 in the config.

But the question in this context is what does it mean when animation is at 50%. Is that the point where the first iteration, left to right, is done or when both iterations are drawn half way through.

pshihn avatar Jun 06 '20 06:06 pshihn

If you run the animation using a linear function from 0% to 100% it should look the same as running it without a progress parameter. So, if both iterations take the same time, 50% is when the first iteration finishes.

pomber avatar Jun 06 '20 16:06 pomber