morphshape animation fix

This commit is contained in:
2015-04-26 16:46:04 +02:00
parent 7803fb78b4
commit d28d72c096
3 changed files with 6 additions and 5 deletions
@@ -688,10 +688,9 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis
int frameCount = timelined.getTimeline().getFrameCount();
int newframe;
if (frameCount > 0) {
if (frame + 1 >= frameCount && !loop) {
newframe = frame;
} else {
newframe = (frame + 1) % frameCount;
newframe = (frame + 1) % frameCount;
if (newframe == 0 && !loop) {
stop();
}
} else {
newframe = frame;
@@ -2825,6 +2825,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
ds.matrix = new MATRIX();
ds.ratio = i * 65535 / framesCnt;
f.layers.put(1, ds);
f.layersChanged = true;
tim.addFrame(f);
}
} else if (tag instanceof FontTag) {
@@ -2836,6 +2837,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
ds.matrix = new MATRIX();
ds.time = i;
f.layers.put(1, ds);
f.layersChanged = true;
tim.addFrame(f);
}
} else {
@@ -397,7 +397,7 @@ public class PlayerControls extends JPanel implements ActionListener, MediaDispl
totalFrameLabel.setText("" + totalFrames);
if (frameRate != 0) {
timeLabel.setText("(" + formatMs((currentFrame * 1000) / frameRate) + ")");
totalTimeLabel.setText("(" + formatMs(((totalFrames - 1) * 1000) / frameRate) + ")");
totalTimeLabel.setText("(" + formatMs((totalFrames * 1000) / frameRate) + ")");
}
if (totalFrames <= 1 && playbackControls.isVisible()) {
playbackControls.setVisible(false);