Merge pull request #14411 from SamGondelman/fading

Fix for avatar flashing on fade out
This commit is contained in:
John Conklin II 2018-11-15 13:58:43 -08:00 committed by GitHub
commit 60c538309a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View file

@ -480,8 +480,8 @@ public:
protected:
PayloadPointer _payload;
ItemKey _key;
ItemCell _cell{ INVALID_CELL };
Index _transitionId{ INVALID_INDEX };
ItemCell _cell { INVALID_CELL };
Index _transitionId { INVALID_INDEX };
friend class Scene;
};

View file

@ -391,7 +391,12 @@ void Scene::transitionItems(const Transaction::TransitionAdds& transactions) {
// Remove pre-existing transition, if need be
if (!TransitionStage::isIndexInvalid(transitionId)) {
resetItemTransition(itemId);
// Only remove if:
// transitioning to something other than none or we're transitioning to none from ELEMENT_LEAVE_DOMAIN or USER_LEAVE_DOMAIN
const auto& oldTransitionType = transitionStage->getTransition(transitionId).eventType;
if (transitionType != Transition::NONE || !(oldTransitionType == Transition::ELEMENT_LEAVE_DOMAIN || oldTransitionType == Transition::USER_LEAVE_DOMAIN)) {
resetItemTransition(itemId);
}
}
// Add a new one.

View file

@ -157,7 +157,7 @@ public:
// This next call are NOT threadsafe, you have to call them from the correct thread to avoid any potential issues
// Access a particular item form its ID
// Access a particular item from its ID
// WARNING, There is No check on the validity of the ID, so this could return a bad Item
const Item& getItem(const ItemID& id) const { return _items[id]; }