mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-23 02:06:46 +08:00
[c][cpp] Fix for #1290, do not carry over time when timeScale of a track entry taht's being replaced by a new one is 0.
This commit is contained in:
parent
57e38a0cb3
commit
ed5dee43ef
@ -280,7 +280,7 @@ void spAnimationState_update (spAnimationState* self, float delta) {
|
|||||||
float nextTime = current->trackLast - next->delay;
|
float nextTime = current->trackLast - next->delay;
|
||||||
if (nextTime >= 0) {
|
if (nextTime >= 0) {
|
||||||
next->delay = 0;
|
next->delay = 0;
|
||||||
next->trackTime = (nextTime / current->timeScale + delta) * next->timeScale;
|
next->trackTime = current->timeScale == 0 ? 0 : (nextTime / current->timeScale + delta) * next->timeScale;
|
||||||
current->trackTime += currentDelta;
|
current->trackTime += currentDelta;
|
||||||
_spAnimationState_setCurrent(self, i, next, 1);
|
_spAnimationState_setCurrent(self, i, next, 1);
|
||||||
while (next->mixingFrom) {
|
while (next->mixingFrom) {
|
||||||
|
|||||||
@ -334,7 +334,7 @@ void AnimationState::update(float delta) {
|
|||||||
float nextTime = current._trackLast - next->_delay;
|
float nextTime = current._trackLast - next->_delay;
|
||||||
if (nextTime >= 0) {
|
if (nextTime >= 0) {
|
||||||
next->_delay = 0;
|
next->_delay = 0;
|
||||||
next->_trackTime = (nextTime / current._timeScale + delta) * next->_timeScale;
|
next->_trackTime = current._timeScale == 0 ? 0 : (nextTime / current._timeScale + delta) * next->_timeScale;
|
||||||
current._trackTime += currentDelta;
|
current._trackTime += currentDelta;
|
||||||
setCurrent(i, next, true);
|
setCurrent(i, next, true);
|
||||||
while (next->_mixingFrom != NULL) {
|
while (next->_mixingFrom != NULL) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user