mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
wasm: Set a GIF background color.
Use a white background by default.
This commit is contained in:
parent
b1c1958c99
commit
750e4d6261
1 changed files with 7 additions and 2 deletions
|
@ -22,8 +22,6 @@
|
|||
|
||||
#include <thorvg.h>
|
||||
#include <emscripten/bind.h>
|
||||
#include "tvgIteratorAccessor.h"
|
||||
|
||||
|
||||
using namespace emscripten;
|
||||
using namespace std;
|
||||
|
@ -242,6 +240,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;
|
||||
|
|
Loading…
Add table
Reference in a new issue