Remove some public Setter/Getter APIs from Dali::Actor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / animated-vector-image / vector-animation-task.cpp
index 213051f..ae66146 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/object/property-array.h>
+#include <dali/public-api/math/math-utils.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
@@ -255,7 +256,7 @@ void VectorAnimationTask::SetPlayRange( Property::Array& playRange )
   }
 
   // Make sure the range specified is between 0 and the total frame number
-  if( startFrame >= 0 && startFrame < mTotalFrame && endFrame >= 0 && endFrame < mTotalFrame )
+  if( startFrame < mTotalFrame && endFrame < mTotalFrame )
   {
     // If the range is not in order swap values
     if( startFrame > endFrame )
@@ -428,6 +429,7 @@ bool VectorAnimationTask::Rasterize()
     if( mPlayState == PlayState::PLAYING && mUpdateFrameNumber )
     {
       mCurrentFrame = mForward ? mCurrentFrame + 1 : mCurrentFrame - 1;
+      Dali::ClampInPlace( mCurrentFrame, mStartFrame, mEndFrame );
     }
 
     currentFrame = mCurrentFrame;