From 1a0af711556a58a29577abf333353d19329ca046 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 15 Jan 2024 10:06:40 +0900 Subject: [PATCH] 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 --- src/tools/svg2png/svg2png.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/svg2png/svg2png.cpp b/src/tools/svg2png/svg2png.cpp index de9e785d..bbfeee54 100644 --- a/src/tools/svg2png/svg2png.cpp +++ b/src/tools/svg2png/svg2png.cpp @@ -130,6 +130,8 @@ public: return 1; } + canvas->clear(); + //Background color if needed if (bgColor != 0xffffffff) { uint8_t r = (uint8_t)((bgColor & 0xff0000) >> 16); @@ -154,8 +156,6 @@ public: cout << "Generated PNG file: " << dst << endl; - canvas->clear(true); - return 0; }