From eef48388c610bf37b07aedef03c55344d450386b Mon Sep 17 00:00:00 2001 From: mattkae Date: Sun, 9 Jan 2022 20:36:08 -0500 Subject: (mkosarek) Beginnig work on snowflake theme --- themes/Renderer2d.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'themes/Renderer2d.cpp') 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; } -- cgit v1.2.1