From 36d646de762ff50e93e0cb84f38ede5dee635a76 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Fri, 28 Jul 2023 21:23:17 +0900 Subject: [PATCH] Make property resetter age down correctly Previously, we call this sequence. frame#1 - ObjectDestroyed (mRunning = AGING) - ResetToBaseValue (mRunning = STOPPED) - IsFinished (mRunning <= STOPPED --> finished!) That mean, this property resetter works only 1 frame. Now make age down on IsFinished function, so age works 2 frames. frame#1 - ObjectDestroyed (mRunning = AGING) - ResetToBaseValue (mRunning = AGING) - IsFinished (mRunning = STOPPED --> not finished!) frame#2 - ResetToBaseValue (mRunning = STOPPED) - IsFinished (mRunning <= STOPPED --> finished!) Change-Id: Ie938df6088c4d73087fc138d29ebbf93df7f8dc7 Signed-off-by: Eunki, Hong --- dali/internal/update/common/property-resetter.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dali/internal/update/common/property-resetter.h b/dali/internal/update/common/property-resetter.h index 4fd1830..833be60 100644 --- a/dali/internal/update/common/property-resetter.h +++ b/dali/internal/update/common/property-resetter.h @@ -81,13 +81,6 @@ public: mBaseProperty->ResetToBaseValue(updateBufferIndex); } - - if(mRunning == AGING) - { - // If this resetter is aging now, make it as stopped. - // Now we can assume that this PropertyResetter is finished. - mRunning = STOPPED; - } }; /** @@ -139,7 +132,14 @@ public: */ virtual bool IsFinished() { - return mRunning <= STOPPED; + const bool finished = mRunning <= STOPPED; + if(mRunning == AGING) + { + // If this resetter is aging now, make it as stopped. + // Now we can assume that this PropertyResetter is finished next frame. + mRunning = STOPPED; + } + return finished; } enum -- 2.7.4