summaryrefslogtreecommitdiff
path: root/themes/Renderer2d.cpp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-01-09 20:36:08 -0500
committermattkae <mattkae@protonmail.com>2022-01-09 20:36:08 -0500
commiteef48388c610bf37b07aedef03c55344d450386b (patch)
tree162a5dd670f4a4a171dde6d7dbf6bb209363e90d /themes/Renderer2d.cpp
parentc3bff045eb9e28e8e49d511c9e15e13db25a2319 (diff)
(mkosarek) Beginnig work on snowflake theme
Diffstat (limited to 'themes/Renderer2d.cpp')
-rw-r--r--themes/Renderer2d.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/themes/Renderer2d.cpp b/themes/Renderer2d.cpp
index 2750557..a58ad86 100644
--- a/themes/Renderer2d.cpp
+++ b/themes/Renderer2d.cpp
@@ -27,12 +27,11 @@ const char* renderer2dFragmentShader =
EM_BOOL onScreenSizeChanged(int eventType, const EmscriptenUiEvent *uiEvent, void *userData) {
Renderer2d* renderer = (Renderer2d*)userData;
- renderer->context->width = uiEvent->documentBodyClientWidth;
- renderer->context->height = uiEvent->documentBodyClientHeight;
- EMSCRIPTEN_RESULT result = emscripten_set_canvas_element_size( renderer->context->query, renderer->context->width, renderer->context->height);
+ EMSCRIPTEN_RESULT result = emscripten_set_canvas_element_size( renderer->context->query, uiEvent->documentBodyClientWidth, uiEvent->documentBodyClientHeight);
if (result != EMSCRIPTEN_RESULT_SUCCESS) {
printf("Failed to resize element at query: %s\n", renderer->context->query);
}
+ renderer->projection = Mat4x4().getOrthographicMatrix(0, renderer->context->width, 0, renderer->context->height);
return true;
}