fix wrong length calculation when adding first mover

This commit is contained in:
yugecin 2016-12-25 12:35:33 +01:00
parent 1803d714a5
commit bf2e71e39b

View File

@ -18,6 +18,7 @@
package yugecin.opsudance.sbv2; package yugecin.opsudance.sbv2;
import itdelatrisu.opsu.objects.curves.Vec2f; import itdelatrisu.opsu.objects.curves.Vec2f;
import itdelatrisu.opsu.ui.Fonts;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics; import org.newdawn.slick.Graphics;
import yugecin.opsudance.sbv2.movers.StoryboardMover; import yugecin.opsudance.sbv2.movers.StoryboardMover;
@ -52,6 +53,8 @@ public class StoryboardMoveImpl implements StoryboardMove {
mover.end = end; mover.end = end;
if (movers.size() == 0) { if (movers.size() == 0) {
mover.start = start; mover.start = start;
mover.recalculateLength();
totalLength += mover.getLength();
} else { } else {
StoryboardMover lastMover = movers.get(movers.size() - 1); StoryboardMover lastMover = movers.get(movers.size() - 1);
Vec2f mid = new Vec2f( Vec2f mid = new Vec2f(