diff --git a/src/loaders/lottie/tvgLottieBuilder.cpp b/src/loaders/lottie/tvgLottieBuilder.cpp index 8aa218f6..a64b66e9 100644 --- a/src/loaders/lottie/tvgLottieBuilder.cpp +++ b/src/loaders/lottie/tvgLottieBuilder.cpp @@ -58,6 +58,7 @@ struct RenderContext float roundness = 0.0f; bool stroking = false; //context has been separated by the stroking bool reqFragment = false; //requirment to fragment the render context + bool allowMerging = true; //individual trimpath doesn't allow merging shapes RenderContext() { @@ -304,7 +305,7 @@ static Shape* _updateFill(LottieGradientFill* fill, int32_t frameNo, RenderConte static Shape* _draw(LottieGroup* parent, int32_t frameNo, RenderContext& ctx) { - if (ctx.merging) return ctx.merging; + if (ctx.allowMerging && ctx.merging) return ctx.merging; auto shape = cast(ctx.propagator->duplicate()); ctx.merging = shape.get(); @@ -702,11 +703,9 @@ static void _updateTrimpath(LottieTrimpath* trimpath, int32_t frameNo, RenderCon end = (length * end) + pbegin; } - if (trimpath->type == LottieTrimpath::Individual) { - TVGERR("LOTTIE", "TODO: Individual Trimpath"); - } - P(ctx.propagator)->strokeTrim(begin, end); + + if (trimpath->type == LottieTrimpath::Individual) ctx.allowMerging = false; } diff --git a/src/loaders/lottie/tvgLottieModel.h b/src/loaders/lottie/tvgLottieModel.h index e9ca26e6..3a27664a 100644 --- a/src/loaders/lottie/tvgLottieModel.h +++ b/src/loaders/lottie/tvgLottieModel.h @@ -240,7 +240,7 @@ struct LottieObject struct LottieTrimpath : LottieObject { - enum Type : uint8_t { Simultaneous = 1, Individual = 2 }; + enum Type : uint8_t { Individual = 1, Simultaneous = 2 }; void prepare() {