
Untitled
By: a guest on
Oct 4th, 2012 | syntax:
Diff | size: 1.17 KB | hits: 115 | expires: Never
diff -r 72f9d6de7aec XeeView.m
--- a/XeeView.m Thu Oct 04 02:01:39 2012 -0700
+++ b/XeeView.m Thu Oct 04 02:26:43 2012 -0700
@@ -51,7 +51,7 @@
delegate=nil;
- NSRect bounds=[self bounds];
+ NSRect bounds=[self convertRectToBacking: [self bounds]];
width=bounds.size.width;
height=bounds.size.height;
@@ -62,6 +62,8 @@
[[self openGLContext] setValues:&val forParameter:NSOpenGLCPSwapInterval];
[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
+
+ [self setWantsBestResolutionOpenGLSurface:YES];
}
return self;
}
@@ -102,7 +104,7 @@
NSPoint focus=[self focus];
- NSRect bounds=[self bounds];
+ NSRect bounds=[self convertRectToBacking: [self bounds]];
width=bounds.size.width;
height=bounds.size.height;
@@ -539,8 +541,10 @@
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;