fix: handle division by 0 in window_use
This commit is contained in:
+4
-3
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user