From 816607027012de0205e144f3edd3fdcfd43db563 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 22 Jul 2019 18:49:09 +0200 Subject: Add functions to get and set view size and position --- pugl/detail/mac_gl.m | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'pugl/detail/mac_gl.m') 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 { -- cgit v1.2.1