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);
|
glfwGetFramebufferSize(window, &width, &height);
|
||||||
context->resolution[0] = width;
|
context->resolution[0] = width;
|
||||||
context->resolution[1] = height;
|
context->resolution[1] = height;
|
||||||
context->tex_resolution[0] =
|
if (height > 0) {
|
||||||
(int)(context->tex_resolution[1] * context->resolution[0] /
|
context->tex_resolution[0] =
|
||||||
context->resolution[1]);
|
(int)(context->tex_resolution[1] * width / height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_close(Window *window) {
|
void window_close(Window *window) {
|
||||||
|
|||||||
Reference in New Issue
Block a user