mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
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:
parent
7e7747d645
commit
aaa5c05cd0
1 changed files with 2 additions and 4 deletions
|
@ -282,7 +282,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
canvas->clear(true);
|
||||
canvas->remove();
|
||||
|
||||
delete(animation);
|
||||
animation = Animation::gen();
|
||||
|
@ -323,7 +323,7 @@ public:
|
|||
|
||||
if (!updated) return engine->output(width, height);
|
||||
|
||||
if (canvas->draw() != Result::Success) {
|
||||
if (canvas->draw(true) != Result::Success) {
|
||||
errorMsg = "draw() fail";
|
||||
return val(typed_memory_view<uint8_t>(0, nullptr));
|
||||
}
|
||||
|
@ -341,8 +341,6 @@ public:
|
|||
|
||||
errorMsg = NoError;
|
||||
|
||||
this->canvas->clear(false);
|
||||
|
||||
if (canvas->update() != Result::Success) {
|
||||
errorMsg = "update() fail";
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue