Permalink
Browse files

Merge pull request #10380 from unknownbrackets/ui-tween

UI: Always apply tweens after restore
  • Loading branch information...
hrydgard committed Dec 10, 2017
2 parents b10b24f + 7b6e73b commit 9ee6d7292e18da88cb15e4c62ca525504fadff4d
Showing with 2 additions and 3 deletions.
  1. +2 −3 ext/native/ui/ui_tween.cpp
@@ -19,7 +19,6 @@ void TweenBase<Value>::PersistData(PersistStatus status, std::string anonId, Per
float duration;
Value from;
Value to;
bool finishApplied;
};
PersistBuffer &buffer = storage["TweenBase::" + anonId];
@@ -33,7 +32,6 @@ void TweenBase<Value>::PersistData(PersistStatus status, std::string anonId, Per
data.duration = duration_;
data.from = from_;
data.to = to_;
data.finishApplied = finishApplied_;
}
break;
case UI::PERSIST_RESTORE:
@@ -43,7 +41,8 @@ void TweenBase<Value>::PersistData(PersistStatus status, std::string anonId, Per
duration_ = data.duration;
from_ = data.from;
to_ = data.to;
finishApplied_ = data.finishApplied;
// We skip finishApplied_ here so that the tween will reapply.
// This does mean it's important to remember to update tweens even after finish.
}
break;
}

0 comments on commit 9ee6d72

Please sign in to comment.