mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
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:
parent
d62b913455
commit
45352c9a1f
2 changed files with 10 additions and 0 deletions
|
@ -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()
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue