svg2png: clear the target buffer before the drawing. (#1910)

buffer clearing is mandatory for the thorvg now.

issue: https://github.com/thorvg/thorvg/issues/1909
This commit is contained in:
Hermet Park 2024-01-15 10:06:40 +09:00 committed by GitHub
parent 7389593235
commit 1a0af71155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,6 +130,8 @@ public:
return 1; return 1;
} }
canvas->clear();
//Background color if needed //Background color if needed
if (bgColor != 0xffffffff) { if (bgColor != 0xffffffff) {
uint8_t r = (uint8_t)((bgColor & 0xff0000) >> 16); uint8_t r = (uint8_t)((bgColor & 0xff0000) >> 16);
@ -154,8 +156,6 @@ public:
cout << "Generated PNG file: " << dst << endl; cout << "Generated PNG file: " << dst << endl;
canvas->clear(true);
return 0; return 0;
} }