From 1ffbc79483c1e068de412cabe7e892e24033d693 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Jul 2019 17:22:42 +0200 Subject: Implement aspect ratio on MacOS Unfortunately MacOS does not seem to support constraints here, so just use the minimum. --- pugl/pugl_osx.m | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pugl') diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index 4a44dab..2507fcb 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -661,6 +661,11 @@ puglCreateWindow(PuglView* view, const char* title) } impl->window = window; + if (view->min_aspect_x && view->min_aspect_y) { + [window setContentAspectRatio:NSMakeSize(view->min_aspect_x, + view->min_aspect_y)]; + } + [window setContentView:impl->glview]; [impl->app activateIgnoringOtherApps:YES]; [window makeFirstResponder:impl->glview]; -- cgit v1.2.1