2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Animated stickers proof of concept.

This commit is contained in:
John Preston
2019-05-10 11:38:23 +03:00
parent 5b04698f5f
commit 707aa88974
4 changed files with 71 additions and 29 deletions

View File

@@ -533,6 +533,7 @@ void DocumentData::setattributes(
}, [&](const MTPDdocumentAttributeHasStickers &data) {
});
}
validateLottieSticker();
if (type == StickerDocument) {
if (dimensions.width() <= 0
|| dimensions.height() <= 0
@@ -551,6 +552,14 @@ void DocumentData::setattributes(
}
}
void DocumentData::validateLottieSticker() {
if (type == FileDocument && _filename == qstr("animation.json")) {
type = StickerDocument;
_additional = std::make_unique<StickerData>();
dimensions = QSize(512, 512);
}
}
bool DocumentData::checkWallPaperProperties() {
if (type == WallPaperDocument) {
return true;