From: Heeyong Song Date: Wed, 18 Dec 2019 10:55:57 +0000 (+0900) Subject: [Tizen](Vector) Ensure the current frame is not out of the play range X-Git-Tag: accepted/tizen/5.5/unified/20191228.075102~15 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=ad314f8d50d653a269158e01ecf3f89b002d8876 [Tizen](Vector) Ensure the current frame is not out of the play range Change-Id: I7077b0de7133f4282b66d2c4de2a1ce6b8555256 --- diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp index a0e1356..ef8a18e 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp @@ -40,6 +40,8 @@ namespace constexpr auto LOOP_FOREVER = -1; constexpr auto NANOSECONDS_PER_SECOND( 1e+9 ); +#define CLAMP( x, low, high ) ( ( ( x ) > ( high ) ) ? ( high ) : ( ( ( x ) < ( low ) ) ? ( low ) : ( x ) ) ) + #if defined(DEBUG_ENABLED) Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_VECTOR_ANIMATION" ); #endif @@ -376,6 +378,7 @@ bool VectorAnimationTask::Rasterize() if( mPlayState == PlayState::PLAYING && mUpdateFrameNumber ) { mCurrentFrame = mForward ? mCurrentFrame + 1 : mCurrentFrame - 1; + mCurrentFrame = CLAMP( mCurrentFrame, mStartFrame, mEndFrame ); } currentFrame = mCurrentFrame;