fix: handle division by 0 in window_use

This commit is contained in:
2026-05-16 18:24:36 +02:00
parent dcb334ff81
commit 8e7be2258f
+4 -3
View File
@@ -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) {