diff --git a/src/bindings/wasm/tvgWasm.cpp b/src/bindings/wasm/tvgWasm.cpp index 1a954423..295c1463 100644 --- a/src/bindings/wasm/tvgWasm.cpp +++ b/src/bindings/wasm/tvgWasm.cpp @@ -22,8 +22,6 @@ #include #include -#include "tvgIteratorAccessor.h" - using namespace emscripten; using namespace std; @@ -232,6 +230,13 @@ public: return false; } + //set a white opaque background + auto bg = tvg::Shape::gen(); + bg->fill(255, 255, 255, 255); + bg->appendRect(0, 0, ow * scale, oh * scale); + + saver->background(std::move(bg)); + if (saver->save(std::move(animation), "output.gif", 100, fps) != tvg::Result::Success) { errorMsg = "save(), fail"; return false;