From a02dd604ff43264757460ca4d87a2dde6ed7bbf0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 10 Jan 2023 21:21:59 -0500 Subject: Remove cached frame from view This was just a source of ambiguity and bugs, since it represented different things at different times and could become stale. Redundant data is always trouble, so eliminate it, leaving just two positions/sizes: the defaults (used when the view is not yet realized), and the last configuration. --- src/mac_stub.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mac_stub.m') diff --git a/src/mac_stub.m b/src/mac_stub.m index ceffa6e..9ebedca 100644 --- a/src/mac_stub.m +++ b/src/mac_stub.m @@ -41,8 +41,11 @@ puglMacStubCreate(PuglView* view) PuglStubView* drawView = [PuglStubView alloc]; drawView->puglview = view; - [drawView - initWithFrame:NSMakeRect(0, 0, view->frame.width, view->frame.height)]; + [drawView initWithFrame:NSMakeRect(0, + 0, + view->lastConfigure.width, + view->lastConfigure.height)]; + if (view->hints[PUGL_RESIZABLE]) { [drawView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; } else { -- cgit v1.2.1