diff --git a/src/window.c b/src/window.c index becc1fe..82de75e 100644 --- a/src/window.c +++ b/src/window.c @@ -131,9 +131,10 @@ void window_use(Window *window, Context *context) { glfwGetFramebufferSize(window, &width, &height); context->resolution[0] = width; context->resolution[1] = height; - context->tex_resolution[0] = - (int)(context->tex_resolution[1] * context->resolution[0] / - context->resolution[1]); + if (height > 0) { + context->tex_resolution[0] = + (int)(context->tex_resolution[1] * width / height); + } } void window_close(Window *window) {