Skip to content

Commit

Permalink
bugfix: Wrong state for scrollbound scenes
Browse files Browse the repository at this point in the history
When the duration is >0 the scene state should be DURING, when the
scroll position equals the scene's start position.

fixes janpaepke#299
  • Loading branch information
janpaepke committed Apr 24, 2015
1 parent 8531f29 commit e7ef270
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dev/src/ScrollMagic/Scene/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ this.progress = function (progress) {
_state = _progress === 0 ? 'BEFORE' : 'DURING';
} else {
// scenes with start and end
if (progress <= 0 && _state !== 'BEFORE' && reverseOrForward) {
if (progress < 0 && _state !== 'BEFORE' && reverseOrForward) {
// go back to initial state
_progress = 0;
_state = 'BEFORE';
doUpdate = true;
} else if (progress > 0 && progress < 1 && reverseOrForward) {
} else if (progress >= 0 && progress < 1 && reverseOrForward) {
_progress = progress;
_state = 'DURING';
doUpdate = true;
Expand Down Expand Up @@ -302,4 +302,4 @@ this.progress = function (progress) {

return Scene;
}
};
};

0 comments on commit e7ef270

Please sign in to comment.