diff --git a/src/bindings/wasm/tvgWasmLottieAnimation.cpp b/src/bindings/wasm/tvgWasmLottieAnimation.cpp index 9d10c625..4bb1e283 100644 --- a/src/bindings/wasm/tvgWasmLottieAnimation.cpp +++ b/src/bindings/wasm/tvgWasmLottieAnimation.cpp @@ -165,6 +165,17 @@ public: return true; } + bool viewport(float x, float y, float width, float height) + { + if (!canvas || !animation) return false; + if (canvas->viewport(x, y, width, height) != Result::Success) { + errorMsg = "viewport() fail"; + return false; + } + + return true; + } + void resize(int width, int height) { if (!canvas || !animation) return; @@ -339,6 +350,7 @@ EMSCRIPTEN_BINDINGS(thorvg_bindings) .function("load", &TvgLottieAnimation ::load) .function("update", &TvgLottieAnimation ::update) .function("frame", &TvgLottieAnimation ::frame) + .function("viewport", &TvgLottieAnimation ::viewport) .function("resize", &TvgLottieAnimation ::resize) .function("save", &TvgLottieAnimation ::save); }