2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use lottie instead of webp in reactions dropdown.

This commit is contained in:
John Preston
2022-01-05 19:53:16 +03:00
parent 409a3357da
commit c0b19000d6
5 changed files with 195 additions and 99 deletions

View File

@@ -26,7 +26,7 @@ namespace {
constexpr auto kRefreshFullListEach = 60 * 60 * crl::time(1000);
constexpr auto kPollEach = 20 * crl::time(1000);
constexpr auto kSizeForDownscale = 128;
constexpr auto kSizeForDownscale = 64;
} // namespace
@@ -163,7 +163,7 @@ void Reactions::loadImage(
}
void Reactions::setLottie(ImageSet &set) {
const auto size = kSizeForDownscale / style::DevicePixelRatio();
const auto size = style::ConvertScale(kSizeForDownscale);
set.icon = std::make_unique<Lottie::Icon>(Lottie::IconDescriptor{
.path = set.media->owner()->filepath(true),
.json = set.media->bytes(),