From 3311c8d82ba5a8ed55d5b402655f6c1adfb8b382 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 18 Jul 2023 15:40:14 +0900 Subject: [PATCH] examples: do not create contents that is over-counted. --- src/examples/Lottie.cpp | 2 ++ src/examples/Svg.cpp | 2 ++ src/examples/Tvg.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/examples/Lottie.cpp b/src/examples/Lottie.cpp index e29ac83f..02481542 100644 --- a/src/examples/Lottie.cpp +++ b/src/examples/Lottie.cpp @@ -42,6 +42,8 @@ static unique_ptr 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; diff --git a/src/examples/Svg.cpp b/src/examples/Svg.cpp index f21dc7c5..eaaf535d 100644 --- a/src/examples/Svg.cpp +++ b/src/examples/Svg.cpp @@ -37,6 +37,8 @@ static std::vector> 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; diff --git a/src/examples/Tvg.cpp b/src/examples/Tvg.cpp index 5bee2a0a..60174c34 100644 --- a/src/examples/Tvg.cpp +++ b/src/examples/Tvg.cpp @@ -37,6 +37,8 @@ static std::vector> 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;