aboutsummaryrefslogtreecommitdiff
path: root/src/platform/graphics/web_canvas/Matrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/graphics/web_canvas/Matrix.cpp')
-rw-r--r--src/platform/graphics/web_canvas/Matrix.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/platform/graphics/web_canvas/Matrix.cpp b/src/platform/graphics/web_canvas/Matrix.cpp
new file mode 100644
index 00000000..6c20062e
--- /dev/null
+++ b/src/platform/graphics/web_canvas/Matrix.cpp
@@ -0,0 +1,10 @@
+#include "cru/platform/graphics/web_canvas/WebCanvasMatrix.h"
+#include "cru/platform/web/Js.h"
+
+namespace cru::platform::graphics::web_canvas {
+emscripten::val CreateDomMatrix(const Matrix &matrix) {
+ return web::js::Construct(
+ "DOMMatrix", std::vector<float>{matrix.m11, matrix.m12, matrix.m21,
+ matrix.m22, matrix.m31, matrix.m32});
+}
+} // namespace cru::platform::graphics::web_canvas