From 7243c7627cc0cc3a9f8ff470e7a7c3d9696ce97d Mon Sep 17 00:00:00 2001 From: Jere Tuliniemi Date: Thu, 9 Jul 2020 12:14:36 +0300 Subject: Fix slide rollback when setting timeline value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The slide has to be rolled back so that elements from the slide don't stick around in the next one. Task-number: QT3DS-4146 Change-Id: I18dbf2b974fb55d4fe22b014c06f54f37df02e13 Reviewed-by: Tomi Korpipää --- src/runtime/Qt3DSComponentManager.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/runtime/Qt3DSComponentManager.cpp b/src/runtime/Qt3DSComponentManager.cpp index bf18a64..ff301da 100644 --- a/src/runtime/Qt3DSComponentManager.cpp +++ b/src/runtime/Qt3DSComponentManager.cpp @@ -126,10 +126,8 @@ void CComponentManager::GotoSlideIndex(TElement *inComponent, } // Update dynamic keys to use current values before slide switching, with the exception of - // master slides because playback only starts from non-master slides. Skip rollback - // if we are expecting a gototime command, as rollback overwrites the attribute changes - // caused by gototime. - if (theCurrentSlideIndex > 0 && !HasComponentGotoTimeCommand(theComponent)) { + // master slides because playback only starts from non-master slides. + if (theCurrentSlideIndex > 0) { m_Presentation.GetSlideSystem().InitializeDynamicKeys( SSlideKey(*theComponent, (qt3ds::QT3DSU8)theGotoSlideData.m_Slide), m_Presentation.GetAnimationSystem()); @@ -137,7 +135,7 @@ void CComponentManager::GotoSlideIndex(TElement *inComponent, m_Presentation.GetSlideSystem().RollbackSlide( SSlideKey(*inComponent, (qt3ds::QT3DSU8)theCurrentSlideIndex), m_Presentation.GetAnimationSystem(), m_Presentation.GetLogicSystem()); - } else if (theCurrentSlideIndex == 0){ + } else { m_Presentation.GetSlideSystem().ExecuteSlide(SSlideKey(*inComponent, 0), m_Presentation.GetAnimationSystem(), m_Presentation.GetLogicSystem()); -- cgit v1.2.3