Advertisement
Guest User

Untitled

a guest
Oct 4th, 2012
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.17 KB | None | 0 0
  1. diff -r 72f9d6de7aec XeeView.m
  2. --- a/XeeView.m Thu Oct 04 02:01:39 2012 -0700
  3. +++ b/XeeView.m Thu Oct 04 02:26:43 2012 -0700
  4. @@ -51,7 +51,7 @@
  5.  
  6.         delegate=nil;
  7.  
  8. -       NSRect bounds=[self bounds];
  9. +       NSRect bounds=[self convertRectToBacking: [self bounds]];
  10.         width=bounds.size.width;
  11.         height=bounds.size.height;
  12.  
  13. @@ -62,6 +62,8 @@
  14.         [[self openGLContext] setValues:&val forParameter:NSOpenGLCPSwapInterval];
  15.  
  16.         [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
  17. +
  18. +       [self setWantsBestResolutionOpenGLSurface:YES];
  19.     }
  20.     return self;
  21.  }
  22. @@ -102,7 +104,7 @@
  23.  
  24.     NSPoint focus=[self focus];
  25.  
  26. -   NSRect bounds=[self bounds];
  27. +   NSRect bounds=[self convertRectToBacking: [self bounds]];
  28.     width=bounds.size.width;
  29.     height=bounds.size.height;
  30.  
  31. @@ -539,8 +541,10 @@
  32.     int oldwidth=imgwidth;
  33.     int oldheight=imgheight;
  34.  
  35. -   imgwidth=size.width;
  36. -   imgheight=size.height;
  37. +   NSRect scale = [self convertRectToBacking:(NSRect){ .size = { 1, 1 } }];
  38. +
  39. +   imgwidth=size.width * scale.size.width;
  40. +   imgheight=size.height * scale.size.height;
  41.  
  42.     focus.x*=(float)imgwidth/(float)oldwidth;
  43.     focus.y*=(float)imgheight/(float)oldheight;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement