Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop bug when delay is > 0 for first item in a sequence #8

Open
hamoid opened this issue Jun 14, 2014 · 1 comment
Open

Loop bug when delay is > 0 for first item in a sequence #8

hamoid opened this issue Jun 14, 2014 · 1 comment
Labels

Comments

@hamoid
Copy link

hamoid commented Jun 14, 2014

When creating a looped sequence, something seems to go wrong if the first item in the sequence has a delay. The issue is not present if other items in the sequence have delays.

Also, only the first variable is affected. In this case it affects only x, but not y or sz.

What seems to happen is, when running seq.start(), the first variable suddenly jumps to the value it should have in the second sequence step (150 instead of 50 in this case).

import de.looksgood.ani.*;

AniSequence seq;
float x=100, y=150, sz=60;

void setup() {
  size(600, 600, P2D);

  // if delayBug is greater than 0, something goes wrong
  float delayBug = 0.0;

  Ani.init(this);
  seq = new AniSequence(this);
  seq.beginSequence();
  seq.add(Ani.to(this, 1, delayBug, "x:50.,y:50,sz:40", Ani.QUAD_IN_OUT ));
  seq.add(Ani.to(this, 1, 1.0, "x:150,y:50,sz:20", Ani.QUAD_IN_OUT ));
  seq.add(Ani.to(this, 1, 1.0, "x:100,y:150,sz:60", Ani.QUAD_IN_OUT, "onEnd:seqEnd"));    
  seq.endSequence();
  seq.start();
}

void draw() {
  background(255);
  ellipse(x, y, sz, sz);
  println(x, y, sz);
}

void seqEnd() {
  println("start");
  seq.start();
}
@b-g
Copy link
Owner

b-g commented Jun 15, 2014

hi @hamoid, many thanks for reporting! will look into it as soon i have time for it ... might take a while as i will be busy traveling in california in the next few weeks. best, b

@b-g b-g added the bug label Jun 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants