diff options
author | David Robillard <d@drobilla.net> | 2023-01-10 21:21:59 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-01-11 03:28:10 -0500 |
commit | a02dd604ff43264757460ca4d87a2dde6ed7bbf0 (patch) | |
tree | 0af34b601c3bc2790228e1f135c2182d5852dac6 /src/mac_stub.m | |
parent | c33edc9b41ccdd7ec3fe711d3a96002b266106bd (diff) | |
download | pugl-a02dd604ff43264757460ca4d87a2dde6ed7bbf0.tar.gz pugl-a02dd604ff43264757460ca4d87a2dde6ed7bbf0.tar.bz2 pugl-a02dd604ff43264757460ca4d87a2dde6ed7bbf0.zip |
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.
Diffstat (limited to 'src/mac_stub.m')
-rw-r--r-- | src/mac_stub.m | 7 |
1 files changed, 5 insertions, 2 deletions
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 { |