mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Added tgs check
This commit is contained in:
parent
1aa9c3d871
commit
7ff263736c
@ -423,6 +423,8 @@ public:
|
||||
* @internal
|
||||
*/
|
||||
~Animation();
|
||||
|
||||
bool isTgs() const;
|
||||
|
||||
private:
|
||||
void setValue(Color_Type, Property, const std::string &, Color);
|
||||
|
@ -47,7 +47,8 @@ public:
|
||||
Surface render(size_t frameNo, const Surface &surface);
|
||||
std::future<Surface> renderAsync(size_t frameNo, Surface &&surface);
|
||||
const LOTLayerNode * renderTree(size_t frameNo, const VSize &size);
|
||||
|
||||
bool isTgs() const { return mModel->isTgs(); }
|
||||
|
||||
const LayerInfoList &layerInfoList() const
|
||||
{
|
||||
return mModel->layerInfoList();
|
||||
@ -266,6 +267,11 @@ std::unique_ptr<Animation> Animation::loadFromFile(const std::string &path)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Animation::isTgs() const
|
||||
{
|
||||
return d->isTgs();
|
||||
}
|
||||
|
||||
void Animation::size(size_t &width, size_t &height) const
|
||||
{
|
||||
VSize sz = d->size();
|
||||
|
@ -569,6 +569,7 @@ public:
|
||||
VSize size() const {return mSize;}
|
||||
void processRepeaterObjects();
|
||||
public:
|
||||
int mTgs;
|
||||
std::string mVersion;
|
||||
VSize mSize;
|
||||
long mStartFrame{0};
|
||||
@ -954,6 +955,7 @@ public:
|
||||
class LOTModel
|
||||
{
|
||||
public:
|
||||
bool isTgs() const {return mRoot->mTgs == 1;}
|
||||
bool isStatic() const {return mRoot->isStatic();}
|
||||
double duration() const {return mRoot->duration();}
|
||||
size_t totalFrame() const {return mRoot->totalFrame();}
|
||||
|
@ -558,7 +558,10 @@ void LottieParserImpl::parseComposition()
|
||||
LOTCompositionData *comp = sharedComposition.get();
|
||||
compRef = comp;
|
||||
while (const char *key = NextObjectKey()) {
|
||||
if (0 == strcmp(key, "v")) {
|
||||
if (0 == strcmp(key, "tgs")) {
|
||||
RAPIDJSON_ASSERT(PeekType() == kNumberType);
|
||||
comp->mTgs = GetInt();
|
||||
}else if (0 == strcmp(key, "v")) {
|
||||
RAPIDJSON_ASSERT(PeekType() == kStringType);
|
||||
comp->mVersion = std::string(GetString());
|
||||
} else if (0 == strcmp(key, "w")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user