API: introduce a Paint ID member as a reserved field

The "id" is a reserved field to specify a paint instance in a scene.
in this change, it assigns the layer id to the lottie scene as well.
This commit is contained in:
Hermet Park 2024-07-06 12:04:56 +09:00 committed by Hermet Park
parent d62b913455
commit 45352c9a1f
2 changed files with 10 additions and 0 deletions

View file

@ -450,6 +450,15 @@ public:
*/
virtual Type type() const noexcept = 0;
/**
* @brief Unique ID of this instance.
*
* This is reserved to specify an paint instance in a scene.
*
* @since Experimental API
*/
uint32_t id = 0;
/**
* @see Paint::type()
*/

View file

@ -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);