Skip to content

Commit

Permalink
animation improvement
Browse files Browse the repository at this point in the history
fewer frames on test91
  • Loading branch information
dkoes committed Mar 15, 2024
1 parent 3aecad3 commit cd46f24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/GLViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3323,12 +3323,12 @@ export class GLViewer {
this.incAnim();
var interval = 100;
var loop = "forward";
var reps = 0;
var reps = Infinity;
options = options || {};
if (options.interval) {
interval = options.interval;
}
if (options.loop) {
if (options.loop) {``
loop = options.loop;
}
if (options.reps) {
Expand Down Expand Up @@ -3381,7 +3381,7 @@ export class GLViewer {
//we no longer exist as part of the DOM
self.stopAnimate();
}
else if (++displayCount == displayMax || !self.isAnimated()) {
else if (++displayCount >= displayMax || !self.isAnimated()) {
timer.cancel();
self.animationTimers.delete(timer);
self.decAnim();
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/tests/test91.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $.get("data/model1.prmtop", function (data){
m.setCoordinates(ret, "netcdf");
viewer.setStyle({},{sphere:{}});
viewer.zoomTo();
viewer.animate({loop:"forward",reps:1});
viewer.animate({loop:"forward",reps:1,step:9});
viewer.render();
});
});

0 comments on commit cd46f24

Please sign in to comment.