wasm: update canvas API usage from clear() to remove()

Following ThorVG API changes (#1372), updated the canvas handling:
- Replaced Canvas::clear() calls with Canvas::remove()
- Updated Canvas::draw() usage to handle buffer clearing
This commit is contained in:
Jinny You 2024-12-11 12:08:05 +09:00 committed by Hermet Park
parent 7e7747d645
commit aaa5c05cd0

View file

@ -282,7 +282,7 @@ public:
return false; return false;
} }
canvas->clear(true); canvas->remove();
delete(animation); delete(animation);
animation = Animation::gen(); animation = Animation::gen();
@ -323,7 +323,7 @@ public:
if (!updated) return engine->output(width, height); if (!updated) return engine->output(width, height);
if (canvas->draw() != Result::Success) { if (canvas->draw(true) != Result::Success) {
errorMsg = "draw() fail"; errorMsg = "draw() fail";
return val(typed_memory_view<uint8_t>(0, nullptr)); return val(typed_memory_view<uint8_t>(0, nullptr));
} }
@ -341,8 +341,6 @@ public:
errorMsg = NoError; errorMsg = NoError;
this->canvas->clear(false);
if (canvas->update() != Result::Success) { if (canvas->update() != Result::Success) {
errorMsg = "update() fail"; errorMsg = "update() fail";
return false; return false;