Skip to content

Commit

Permalink
Fixed Division by 0 when minimizing window: Merge branch 'toadster122'
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshinm committed Apr 6, 2017
2 parents 10c3b0c + 3b38550 commit 5c054e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ int get_scale_factor() {
int window_width, window_height;
int buffer_width, buffer_height;
glfwGetWindowSize(g->window, &window_width, &window_height);
if (window_width <= 0 || window_height <= 0) {
return 0;
}
glfwGetFramebufferSize(g->window, &buffer_width, &buffer_height);
int result = buffer_width / window_width;
result = MAX(1, result);
Expand Down

0 comments on commit 5c054e6

Please sign in to comment.