From b9b1336817d3fb2484b28345955b397ea63390c3 Mon Sep 17 00:00:00 2001 From: Jinny You Date: Thu, 19 Sep 2024 14:35:14 +0900 Subject: [PATCH] lottie/text: hotfix for parsing text range issue If randomize is not enabled, "rn" prop falls into skip() --- src/loaders/lottie/tvgLottieParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/lottie/tvgLottieParser.cpp b/src/loaders/lottie/tvgLottieParser.cpp index 01f5ed97..ee0e964f 100644 --- a/src/loaders/lottie/tvgLottieParser.cpp +++ b/src/loaders/lottie/tvgLottieParser.cpp @@ -1123,7 +1123,7 @@ void LottieParser::parseTextRange(LottieText* text) else if (KEY_AS("ne")) parseProperty(selector->minEase); else if (KEY_AS("a")) parseProperty(selector->maxAmount); else if (KEY_AS("b")) selector->based = (LottieTextRange::Based) getInt(); - else if (KEY_AS("rn") && getInt()) selector->random = rand(); + else if (KEY_AS("rn")) selector->random = getInt() ? rand() : 0; else if (KEY_AS("sh")) selector->shape = (LottieTextRange::Shape) getInt(); else if (KEY_AS("o")) parseProperty(selector->offset); else if (KEY_AS("r")) selector->rangeUnit = (LottieTextRange::Unit) getInt();