Commits

Hong Minhee committed 7cb8bb7

Comments (0)

Files changed (1)

 
 		delegate=nil;
 
-		NSRect bounds=[self bounds];
+		NSRect bounds=[self convertRectToBacking: [self bounds]];
 		width=bounds.size.width;
 		height=bounds.size.height;
 
 		[[self openGLContext] setValues:&val forParameter:NSOpenGLCPSwapInterval];
 
 		[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
+
+		[self setWantsBestResolutionOpenGLSurface:YES];
 	}
 	return self;
 }
 
 	NSPoint focus=[self focus];
 
-	NSRect bounds=[self bounds];
+	NSRect bounds=[self convertRectToBacking: [self bounds]];
 	width=bounds.size.width;
 	height=bounds.size.height;
 
 	int oldwidth=imgwidth;
 	int oldheight=imgheight;
 
-	imgwidth=size.width;
-	imgheight=size.height;
+	NSRect scale = [self convertRectToBacking:(NSRect){ .size = { 1, 1 } }];
+
+	imgwidth=size.width * scale.size.width;
+	imgheight=size.height * scale.size.height;
 
 	focus.x*=(float)imgwidth/(float)oldwidth;
 	focus.y*=(float)imgheight/(float)oldheight;