Do not reset animation frame when restarting while we're fading out.

Keeps it smooth if we're oscillating on some theshold between running and not.)
This commit is contained in:
Howard Stearns 2015-08-31 11:09:28 -07:00
parent 08986dcb17
commit a907c5757b

View file

@ -10,7 +10,7 @@
//
#include "AnimationHandle.h"
#include "AnimationLogging.h"
void AnimationHandle::setURL(const QUrl& url) {
if (_url != url) {
@ -51,8 +51,8 @@ void AnimationHandle::setMaskedJoints(const QStringList& maskedJoints) {
}
void AnimationHandle::setRunning(bool running, bool doRestoreJoints) {
if (running && isRunning()) {
// if we're already running, this is the same as a restart
if (running && isRunning() && (getFadePerSecond() >= 0.0f)) {
// if we're already running, this is the same as a restart -- unless we're fading out.
setFrameIndex(getFirstFrame());
return;
}