AS1/2 button action execution

This commit is contained in:
Jindra Petřík
2021-03-30 22:42:55 +02:00
parent 23c4c03eec
commit 63a5f573cd
2 changed files with 38 additions and 9 deletions

View File

@@ -338,8 +338,8 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
//updateZoom();
int totalFrames = display.getTotalFrames();
int currentFrame = display.getCurrentFrame();
if (currentFrame >= totalFrames) {
currentFrame = totalFrames - 1;
if (currentFrame > totalFrames) {
currentFrame = totalFrames;
}
float frameRate = display.getFrameRate();
Zoom zoom = display.getZoom();
@@ -373,13 +373,13 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
} else {
progress.setMaximum(totalFrames - 1);
progress.setMinimum(0);
progress.setValue(currentFrame);
progress.setValue(currentFrame - 1);
progress.setIndeterminate(false);
}
frameLabel.setText(Integer.toString(currentFrame + 1));
frameLabel.setText(Integer.toString(currentFrame));
totalFrameLabel.setText(Integer.toString(totalFrames));
if (frameRate != 0) {
timeLabel.setText("(" + formatMs((int) (currentFrame * 1000.0 / frameRate)) + ")");
timeLabel.setText("(" + formatMs((int) ((currentFrame - 1) * 1000.0 / frameRate)) + ")");
totalTimeLabel.setText("(" + formatMs((int) (totalFrames * 1000.0 / frameRate)) + ")");
}
if (totalFrames <= 1 && playbackControls.isVisible()) {