diff --git a/inc/thorvg.h b/inc/thorvg.h index 54d9d6e0..3f43fe08 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -430,6 +430,15 @@ public: */ uint32_t identifier() const noexcept; + /** + * @brief Unique ID of this instance. + * + * This is reserved to specify an paint instance in a scene. + * + * @since Experimental API + */ + uint32_t id = 0; + _TVG_DECLARE_PRIVATE(Paint); }; diff --git a/src/loaders/lottie/tvgLottieBuilder.cpp b/src/loaders/lottie/tvgLottieBuilder.cpp index 1023fdee..de0b0642 100644 --- a/src/loaders/lottie/tvgLottieBuilder.cpp +++ b/src/loaders/lottie/tvgLottieBuilder.cpp @@ -1270,6 +1270,7 @@ static void _updateLayer(LottieComposition* comp, Scene* scene, LottieLayer* lay //Prepare render data layer->scene = Scene::gen().release(); + layer->scene->id = layer->id; //ignore opacity when Null layer? if (layer->type != LottieLayer::Null) layer->scene->opacity(layer->cache.opacity);