mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
lottie: fix text range selector translation
Scaling the entire scene caused unintended scaling of the translation in the text range selector.
This commit is contained in:
parent
d9be58d4b7
commit
144fecc3a1
1 changed files with 2 additions and 2 deletions
|
@ -1063,7 +1063,7 @@ void LottieBuilder::updateText(LottieLayer* layer, float frameNo)
|
||||||
if (!text->ranges.empty()) {
|
if (!text->ranges.empty()) {
|
||||||
Point scaling = {1.0f, 1.0f};
|
Point scaling = {1.0f, 1.0f};
|
||||||
auto rotation = 0.0f;
|
auto rotation = 0.0f;
|
||||||
auto translation = cursor;
|
Point translation = {0.0f, 0.0f};
|
||||||
|
|
||||||
//text range process
|
//text range process
|
||||||
for (auto s = text->ranges.begin(); s < text->ranges.end(); ++s) {
|
for (auto s = text->ranges.begin(); s < text->ranges.end(); ++s) {
|
||||||
|
@ -1098,7 +1098,7 @@ void LottieBuilder::updateText(LottieLayer* layer, float frameNo)
|
||||||
}
|
}
|
||||||
auto& matrix = shape->transform();
|
auto& matrix = shape->transform();
|
||||||
identity(&matrix);
|
identity(&matrix);
|
||||||
translate(&matrix, translation.x, translation.y);
|
translate(&matrix, translation.x / scale + cursor.x, translation.y / scale + cursor.y);
|
||||||
tvg::scale(&matrix, scaling.x, scaling.y);
|
tvg::scale(&matrix, scaling.x, scaling.y);
|
||||||
rotate(&matrix, rotation);
|
rotate(&matrix, rotation);
|
||||||
shape->transform(matrix);
|
shape->transform(matrix);
|
||||||
|
|
Loading…
Add table
Reference in a new issue