Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

_POPPropertyAnimationState isPaused reset the progress #410

Open
showxu opened this issue Jun 13, 2018 · 0 comments
Open

_POPPropertyAnimationState isPaused reset the progress #410

showxu opened this issue Jun 13, 2018 · 0 comments

Comments

@showxu
Copy link

showxu commented Jun 13, 2018

When the POPPropertyAnimation switch to unpaused state by setting isPaused property to true, the function blow in struct _POPAnimationState is triggered

void setPaused(bool f) {
  if (f != paused) {
   paused = f;
     if (!paused) {
       reset(false);
     }
  }
}

function virtual void reset(bool all) in setPausedfucntion body will trigger a v-table dispatch to
reset function of struct _POPPropertyAnimationState

virtual void reset(bool all) {
  _POPAnimationState::reset(all);

    if (all) {
      currentVec = NULL;
      previousVec = NULL;
      previous2Vec = NULL;
    }
  progress = 0;
  resetProgressMarkerState();
  didReachToValue = false;
  distanceVec = NULL;
}

which will reset the animation progress, cause the animation restart from the origin state.

Is there any special reason to make such design? It cause my animation on layer restart when resume form the paused state.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant