Skip to content

Commit

Permalink
Merge pull request godotengine#82037 from bruvzg/macos_gl_min_size
Browse files Browse the repository at this point in the history
[macOS] Enforce non-zero window size.
  • Loading branch information
akien-mga committed Sep 21, 2023
2 parents cc0a02c + 901e090 commit 603119d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@

// initWithContentRect uses bottom-left corner of the window’s frame as origin.
wd.window_object = [[GodotWindow alloc]
initWithContentRect:NSMakeRect(100, 100, p_rect.size.width / scale, p_rect.size.height / scale)
initWithContentRect:NSMakeRect(100, 100, MAX(1, p_rect.size.width / scale), MAX(1, p_rect.size.height / scale))
styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable
backing:NSBackingStoreBuffered
defer:NO];
Expand Down Expand Up @@ -2914,7 +2914,7 @@
top_left.x = old_frame.origin.x;
top_left.y = NSMaxY(old_frame);

NSRect new_frame = NSMakeRect(0, 0, size.x, size.y);
NSRect new_frame = NSMakeRect(0, 0, MAX(1, size.x), MAX(1, size.y));
new_frame = [wd.window_object frameRectForContentRect:new_frame];

new_frame.origin.x = top_left.x;
Expand Down

0 comments on commit 603119d

Please sign in to comment.