diff options
author | Antti Määttä <antti.maatta@qt.io> | 2020-04-30 09:13:22 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2020-05-04 12:48:58 +0300 |
commit | fcfe2c787a6429323afe974ee8d9abcf8f2747ee (patch) | |
tree | 055f0e4f81ba998fdc235f47b7026e2d12fd100b | |
parent | bd83fc18faf1fb471c935c228916f9aff4a134b1 (diff) |
Fix activating child elements when di activating
Time-activation is not done for child elements in all cases. Add check for
it in the activation handler.
Task-number: QT3DS-4100
Change-Id: Ib34777afc35db7a0ce6748da01e6feec1de37f5e
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
-rw-r--r-- | src/runtime/Qt3DSActivationManager.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/runtime/Qt3DSActivationManager.cpp b/src/runtime/Qt3DSActivationManager.cpp index e975c7d..ee17f1e 100644 --- a/src/runtime/Qt3DSActivationManager.cpp +++ b/src/runtime/Qt3DSActivationManager.cpp @@ -555,17 +555,24 @@ struct STimeContext inScanBuffer.push_back(SScanBufferEntry(&inNode, parentActive)); } - + bool parentDiActiveChange = false; for (QT3DSU32 idx = 0, end = inScanBuffer.size(); idx < end; ++idx) { SScanBufferEntry theEntry(inScanBuffer[idx]); SElement *theScanNode = theEntry.m_Node; QT3DS_ASSERT(theScanNode->IsIndependent() == false); bool parentActive = theEntry.IsParentActive(); bool wasActive = theScanNode->IsGlobalActive(); - bool isControlledByDi = controlledList.contains(*theScanNode) && theScanNode->m_OnMaster; - + if (!isControlledByDi && parentDiActiveChange && parentActive && !wasActive + && !theScanNode->IsTimeActive() && theScanNode->IsExplicitActive()) { + // Set time active for datainput activated child nodes + theScanNode->m_ActivationManagerNode.m_Flags.SetTimeActive(true); + } + bool diActiveChange = isControlledByDi + && (theScanNode->IsGlobalActive(parentActive) + != theScanNode->IsControlledActive()); + parentDiActiveChange |= diActiveChange; // Override visibility for master slide elements that have datainput eyeball controller. bool isActive = isControlledByDi ? theScanNode->IsControlledActive() : theScanNode->IsGlobalActive(parentActive); @@ -576,9 +583,7 @@ struct STimeContext if (activateChange) { HandleActivationChange(*theScanNode, activateBuffer, deactivateBuffer, scriptBuffer, inElementAccessMutex, scriptBufferRequiresSort, isActive); - } else if (isControlledByDi - && (theScanNode->IsGlobalActive(parentActive) - != theScanNode->IsControlledActive())) { + } else if (diActiveChange) { // Notify only if datainput control actually disagreed with activity value // coming from activity manager. qCInfo(TRACE_INFO) << "Element" << theScanNode->name().c_str() @@ -644,7 +649,7 @@ struct STimeContext TElementNodePtrList &inTempDirtyList, TElementAndSortKeyList &activateBuffer, TElementAndSortKeyList &deactivateBuffer, TElementAndSortKeyList &scriptBuffer, bool &scriptBufferRequiresSort, Q3DStudio::CComponentManager &inComponentManager, - IPerfTimer &inPerfTimer, IActivityZone &inZone) + IPerfTimer &, IActivityZone &inZone) { SComponent &theContextNode = m_Component; bool parentActive = true; |