lottie: simplify text layout calculation

This commit is contained in:
Jinny You 2025-04-04 17:06:36 +09:00 committed by Hermet Park
parent 9bc3d5e3b7
commit 2b3cdb0d97

View file

@ -968,7 +968,7 @@ void LottieBuilder::updateText(LottieLayer* layer, float frameNo)
Point layout = {doc.bbox.pos.x, doc.bbox.pos.y + ascent - doc.shift};
//horizontal alignment
layout.x += -1.0f * doc.bbox.size.x * doc.justify + (cursor.x * scale) * doc.justify;
layout.x += doc.justify * (-1.0f * doc.bbox.size.x + cursor.x * scale);
//new text group, single scene based on text-grouping
scene->push(textGroup);