mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
examples: do not create contents that is over-counted.
This commit is contained in:
parent
ca7a9068bd
commit
3311c8d82b
3 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,8 @@ static unique_ptr<tvg::SwCanvas> swCanvas;
|
|||
|
||||
void lottieDirCallback(const char* name, const char* path, void* data)
|
||||
{
|
||||
if (counter >= NUM_PER_ROW * NUM_PER_COL) return;
|
||||
|
||||
//ignore if not lottie file.
|
||||
const char *ext = name + strlen(name) - 4;
|
||||
if (strcmp(ext, "json")) return;
|
||||
|
|
|
@ -37,6 +37,8 @@ static std::vector<unique_ptr<tvg::Picture>> pictures;
|
|||
|
||||
void svgDirCallback(const char* name, const char* path, void* data)
|
||||
{
|
||||
if (counter >= NUM_PER_ROW * NUM_PER_COL) return;
|
||||
|
||||
//ignore if not svgs.
|
||||
const char *ext = name + strlen(name) - 3;
|
||||
if (strcmp(ext, "svg")) return;
|
||||
|
|
|
@ -37,6 +37,8 @@ static std::vector<unique_ptr<tvg::Picture>> pictures;
|
|||
|
||||
void tvgDirCallback(const char* name, const char* path, void* data)
|
||||
{
|
||||
if (counter >= NUM_PER_ROW * NUM_PER_COL) return;
|
||||
|
||||
//ignore if not tvgs.
|
||||
const char *ext = name + strlen(name) - 3;
|
||||
if (strcmp(ext, "tvg")) return;
|
||||
|
|
Loading…
Add table
Reference in a new issue