mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
example: modify the tvg example to plot all of the files
This commit is contained in:
parent
5be27a151e
commit
6b7aff560f
1 changed files with 4 additions and 3 deletions
|
@ -27,8 +27,9 @@
|
|||
/* Drawing Commands */
|
||||
/************************************************************************/
|
||||
|
||||
#define NUM_PER_LINE 6
|
||||
#define SIZE (WIDTH/NUM_PER_LINE)
|
||||
#define NUM_PER_ROW 7
|
||||
#define NUM_PER_COL 6
|
||||
#define SIZE (WIDTH/NUM_PER_ROW)
|
||||
|
||||
static int count = 0;
|
||||
|
||||
|
@ -48,7 +49,7 @@ void tvgDirCallback(const char* name, const char* path, void* data)
|
|||
if (picture->load(buf) != tvg::Result::Success) return;
|
||||
|
||||
picture->size(SIZE, SIZE);
|
||||
picture->translate((count % NUM_PER_LINE) * SIZE, SIZE * (count / NUM_PER_LINE));
|
||||
picture->translate((count % NUM_PER_ROW) * SIZE, (count / NUM_PER_ROW) * (HEIGHT / NUM_PER_COL));
|
||||
|
||||
pictures.push_back(move(picture));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue