mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed an issue where the interpolation property did not work for the animation element when using Lottie animation files
This commit is contained in:
parent
7d32aac99d
commit
c988170641
|
@ -343,6 +343,22 @@ void LottieAnimComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
mIterationCount *= 2;
|
||||
}
|
||||
|
||||
if (elem->has("interpolation")) {
|
||||
const std::string& interpolation {elem->get<std::string>("interpolation")};
|
||||
if (interpolation == "linear") {
|
||||
mTexture->setLinearMagnify(true);
|
||||
}
|
||||
else if (interpolation == "nearest") {
|
||||
mTexture->setLinearMagnify(false);
|
||||
}
|
||||
else {
|
||||
mTexture->setLinearMagnify(false);
|
||||
LOG(LogWarning) << "LottieAnimComponent: Invalid theme configuration, property "
|
||||
"\"interpolation\" for element \""
|
||||
<< element.substr(10) << "\" defined as \"" << interpolation << "\"";
|
||||
}
|
||||
}
|
||||
|
||||
if (elem->has("cornerRadius"))
|
||||
mCornerRadius =
|
||||
glm::clamp(elem->get<float>("cornerRadius"), 0.0f, 0.5f) * mRenderer->getScreenWidth();
|
||||
|
|
Loading…
Reference in a new issue