Added trim paths props 52/316152/5
authorjoogab.yun <joogab.yun@samsung.com>
Wed, 14 Aug 2024 06:30:10 +0000 (15:30 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Mon, 19 Aug 2024 06:18:53 +0000 (15:18 +0900)
Change-Id: I92584e16902c3eda1d5ebac19a8b0ad9bbd14bfd

dali-extension/vector-animation-renderer/vector-animation-renderer.cpp

index 13489f0fa8775526d7268a054a33efe7e62d48f7..ce3da485ffff6820c81ea974258223b4a2477931 100644 (file)
@@ -471,6 +471,34 @@ void VectorAnimationRenderer::AddPropertyValueCallback(const std::string& keyPat
                                                                   });
           break;
         }
+        case VectorProperty::TRIM_START:
+        {
+          mVectorRenderer->setValue<rlottie::Property::TrimStart>(keyPath,
+                                                                  [property, callback, id](const rlottie::FrameInfo& info) {
+                                                                    Property::Value value = CallbackBase::ExecuteReturn<Property::Value>(*callback, id, property, info.curFrame());
+                                                                    float           start;
+                                                                    if(value.Get(start))
+                                                                    {
+                                                                      return start;
+                                                                    }
+                                                                    return 0.0f;
+                                                                  });
+          break;
+        }
+        case VectorProperty::TRIM_END:
+        {
+          mVectorRenderer->setValue<rlottie::Property::TrimEnd>(keyPath,
+                                                                  [property, callback, id](const rlottie::FrameInfo& info) {
+                                                                    Property::Value value = CallbackBase::ExecuteReturn<Property::Value>(*callback, id, property, info.curFrame());
+                                                                    Vector2         position;
+                                                                    if(value.Get(position))
+                                                                    {
+                                                                      return rlottie::Point(position.x, position.y);
+                                                                    }
+                                                                    return rlottie::Point(0.0f, 100.0f);
+                                                                  });
+          break;
+        }
       }
     }
   }