Fix a resizing issue with AWTGLCanvas on OS X

This commit is contained in:
kappaOne 2013-04-14 14:54:11 +01:00
parent a7c704ae2f
commit 0c07657edf
1 changed files with 7 additions and 4 deletions

View File

@ -109,10 +109,13 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXCanvasPeerInfo_nInitHandle
// get root layer of the AWT Canvas and add self to it
id <JAWT_SurfaceLayers> surfaceLayers = (id <JAWT_SurfaceLayers>)macosx_dsi;
surfaceLayers.layer = self;
// ensure the CALayer size is correct, needed for Java 7+
self.frame = CGRectMake(0, 0, [self getWidth], [self getHeight]);
if (surfaceLayers.layer != self) {
surfaceLayers.layer = self;
// ensure the CALayer size is correct, needed for Java 7+
self.frame = CGRectMake(0, 0, [self getWidth], [self getHeight]);
}
}
- (void) removeLayer {