diff options
author | David Robillard <d@drobilla.net> | 2019-07-22 18:49:09 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-09-03 08:34:38 +0200 |
commit | 816607027012de0205e144f3edd3fdcfd43db563 (patch) | |
tree | 6baafc16e21b6186c51d9ada7c97116b6a30811c /pugl/detail/mac_gl.m | |
parent | f76954359229c25a6c9d29d6de3e75ab3a25f8dd (diff) | |
download | pugl-816607027012de0205e144f3edd3fdcfd43db563.tar.gz pugl-816607027012de0205e144f3edd3fdcfd43db563.tar.bz2 pugl-816607027012de0205e144f3edd3fdcfd43db563.zip |
Add functions to get and set view size and position
Diffstat (limited to 'pugl/detail/mac_gl.m')
-rw-r--r-- | pugl/detail/mac_gl.m | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/pugl/detail/mac_gl.m b/pugl/detail/mac_gl.m index 1392989..58d815d 100644 --- a/pugl/detail/mac_gl.m +++ b/pugl/detail/mac_gl.m @@ -82,15 +82,7 @@ typedef NSUInteger NSWindowStyleMask; PuglWrapperView* wrapper = (PuglWrapperView*)[self superview]; [super reshape]; - [wrapper dispatchConfigure:[self bounds]]; -} - -- (void) update -{ - PuglWrapperView* wrapper = (PuglWrapperView*)[self superview]; - - [super update]; - [wrapper dispatchConfigure:[self bounds]]; + [wrapper setReshaped]; } - (void) drawRect:(NSRect)rect @@ -112,9 +104,11 @@ puglMacGlCreate(PuglView* view) { PuglInternals* impl = view->impl; PuglOpenGLView* drawView = [PuglOpenGLView alloc]; + const NSRect rect = NSMakeRect( + 0, 0, view->frame.width, view->frame.height); drawView->puglview = view; - [drawView initWithFrame:NSMakeRect(0, 0, view->width, view->height)]; + [drawView initWithFrame:rect]; if (view->hints[PUGL_RESIZABLE]) { [drawView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; } else { |