mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
lottie/text: Fix incorrect text range without end condition
Improving text render compatibility by fixing wrong Text Range. When lottie doesn't have `end` prop in the range, system must ignore condition regarding to `end`. The original logic unintentionally swaps `start` and `end` prop, because `end` is the zero in this case. Then the text range animation behaves the opposite.
This commit is contained in:
parent
d70aa68dcc
commit
d70ddcd67c
2 changed files with 2 additions and 1 deletions
|
@ -1053,6 +1053,7 @@ void LottieBuilder::updateText(LottieLayer* layer, float frameNo)
|
||||||
}
|
}
|
||||||
shape->fill(doc.color.rgb[0], doc.color.rgb[1], doc.color.rgb[2]);
|
shape->fill(doc.color.rgb[0], doc.color.rgb[1], doc.color.rgb[2]);
|
||||||
shape->translate(cursor.x, cursor.y);
|
shape->translate(cursor.x, cursor.y);
|
||||||
|
shape->opacity(255);
|
||||||
|
|
||||||
if (doc.stroke.render) {
|
if (doc.stroke.render) {
|
||||||
shape->strokeJoin(StrokeJoin::Round);
|
shape->strokeJoin(StrokeJoin::Round);
|
||||||
|
|
|
@ -180,7 +180,7 @@ struct LottieTextRange
|
||||||
LottieFloat maxAmount = 0.0f;
|
LottieFloat maxAmount = 0.0f;
|
||||||
LottieFloat smoothness = 0.0f;
|
LottieFloat smoothness = 0.0f;
|
||||||
LottieFloat start = 0.0f;
|
LottieFloat start = 0.0f;
|
||||||
LottieFloat end = 0.0f;
|
LottieFloat end = FLT_MAX;
|
||||||
Based based = Chars;
|
Based based = Chars;
|
||||||
Shape shape = Square;
|
Shape shape = Square;
|
||||||
Unit rangeUnit = Percent;
|
Unit rangeUnit = Percent;
|
||||||
|
|
Loading…
Add table
Reference in a new issue