diff options
-rw-r--r-- | src/runtime/Qt3DSComponentManager.cpp | 3 | ||||
-rw-r--r-- | src/runtime/Qt3DSElementSystem.h | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/runtime/Qt3DSComponentManager.cpp b/src/runtime/Qt3DSComponentManager.cpp index 5eaf52a..73c3467 100644 --- a/src/runtime/Qt3DSComponentManager.cpp +++ b/src/runtime/Qt3DSComponentManager.cpp @@ -85,7 +85,8 @@ void CComponentManager::GotoSlideIndex(TElement *inComponent, return; } - if (theComponent->GetActive() == false) { + if (!theComponent->GetActive() || theComponent->AboutToDeactivate()) { + // When (becoming) not active, don't proceed slide switching m_ComponentInitialSlideMap[inComponent] = inGotoData; return; } diff --git a/src/runtime/Qt3DSElementSystem.h b/src/runtime/Qt3DSElementSystem.h index f2430ed..d8790d7 100644 --- a/src/runtime/Qt3DSElementSystem.h +++ b/src/runtime/Qt3DSElementSystem.h @@ -460,6 +460,7 @@ namespace runtime { bool GetActive() const { return m_Flags.IsActive(); } // Return true if we are about to activate, but have not yet been activated + // Also returns true when dirty and already active bool AboutToActivate() const { if (!IsDirty()) @@ -467,6 +468,15 @@ namespace runtime { return IsExplicitActive(); } + // Return true if we are about to deactivate, but have not yet been deactivated + // Also returns true when dirty and already not active + bool AboutToDeactivate() const + { + if (!IsDirty()) + return false; + return !IsExplicitActive(); + } + bool IsAnyParentAboutToActivate() { SElement *parent = GetParent(); |