aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac_stub.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-10 21:21:59 -0500
committerDavid Robillard <d@drobilla.net>2023-01-11 03:28:10 -0500
commita02dd604ff43264757460ca4d87a2dde6ed7bbf0 (patch)
tree0af34b601c3bc2790228e1f135c2182d5852dac6 /src/mac_stub.m
parentc33edc9b41ccdd7ec3fe711d3a96002b266106bd (diff)
downloadpugl-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.m7
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 {