mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00
examples: add commentary for exceptions.
This commit is contained in:
parent
a0f28d0db4
commit
89d35123d8
2 changed files with 9 additions and 3 deletions
|
@ -32,7 +32,10 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
|||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
auto picture = tvg::Picture::gen();
|
||||
if (picture->load(EXAMPLE_DIR"/logo.png") != tvg::Result::Success) return;
|
||||
if (picture->load(EXAMPLE_DIR"/logo.png") != tvg::Result::Success) {
|
||||
cout << "PNG is not supported, Did you enable PNG Loader??" << endl;
|
||||
return;
|
||||
}
|
||||
picture->translate(i* 150, i * 150);
|
||||
picture->rotate(30 * i);
|
||||
picture->scale(0.25);
|
||||
|
|
|
@ -31,7 +31,10 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
|||
if (!canvas) return;
|
||||
|
||||
auto picture = tvg::Picture::gen();
|
||||
picture->load(EXAMPLE_DIR"/test.tvg");
|
||||
if (picture->load(EXAMPLE_DIR"/test.tvg") != tvg::Result::Success) {
|
||||
cout << "TVG is not supported, Did you enable TVG Loader??" << endl;
|
||||
return;
|
||||
}
|
||||
canvas->push(move(picture));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue