mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
lottie: fix repeater order
Assigning numbers 1 or 2 to a bool always resulted in true. Now fixed and repeated shapes are drawn in the proper order. If the repeater had no elements, iterating shapes from the end would result in a segf. This issue is now fixed.
This commit is contained in:
parent
6f33a2bcbb
commit
d7ab592fb9
2 changed files with 2 additions and 2 deletions
|
@ -437,7 +437,7 @@ static void _repeat(LottieGroup* parent, unique_ptr<Shape> path, RenderContext*
|
|||
parent->scene->push(cast(*shape));
|
||||
propagators.push(*shape);
|
||||
}
|
||||
} else {
|
||||
} else if (!shapes.empty()) {
|
||||
for (auto shape = shapes.end() - 1; shape >= shapes.begin(); --shape) {
|
||||
parent->scene->push(cast(*shape));
|
||||
propagators.push(*shape);
|
||||
|
|
|
@ -828,7 +828,7 @@ LottieRepeater* LottieParser::parseRepeater()
|
|||
if (parseCommon(repeater, key)) continue;
|
||||
else if (KEY_AS("c")) parseProperty<LottieProperty::Type::Float>(repeater->copies);
|
||||
else if (KEY_AS("o")) parseProperty<LottieProperty::Type::Float>(repeater->offset);
|
||||
else if (KEY_AS("m")) repeater->inorder = getInt();
|
||||
else if (KEY_AS("m")) repeater->inorder = getInt() == 2;
|
||||
else if (KEY_AS("tr"))
|
||||
{
|
||||
enterObject();
|
||||
|
|
Loading…
Add table
Reference in a new issue