gorlok / java-universal-tween-engine

Automatically exported from code.google.com/p/java-universal-tween-engine
0 stars 0 forks source link

Found bug and fix #23

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Having a timeline inside a timeline, where the parent timeline yoyos causes 
some errors.  Before starting the yoyo repeat, it jumps to end values.

The fix is simple, and you can tell that it was a mistake.  Since the original 
programmer always has two sets of code for when the tween is going forward and 
one for backward, but he did not change the line about the deltas.  They just 
need to be swapped.

Fix by replacing this code in Timeline.java:
if (!isIterationStep && step < lastStep) {
            assert delta <= 0;
            float dt = isReverse(lastStep) ? -delta-1 : delta+1;
            for (int i=children.size()-1; i>=0; i--) children.get(i).update(dt);
            return;
        }
with:
if (!isIterationStep && step < lastStep) {
            assert delta <= 0;
            float dt = isReverse(lastStep) ? delta+1 : -delta-1;
            for (int i=children.size()-1; i>=0; i--) children.get(i).update(dt);
            return;
        }

Original issue reported on code.google.com by berberic...@gmail.com on 2 Jun 2014 at 12:49