Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make NSWindow+ULIZoomEffect work on Retina screens. (untested)

  • Loading branch information...
commit 3a5096e383d73fc49ea4c759b8a0fde61c2bfb01 1 parent 017692b
Uli Kusterer authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 NSWindow+ULIZoomEffect.m
7 NSWindow+ULIZoomEffect.m
View
@@ -57,6 +57,7 @@ @interface NSWindow (ULITenSevenAnimationBehaviour)
-(void) setAnimationBehavior: (NSWindowAnimationBehavior)animBehaviour;
-(NSWindowAnimationBehavior) animationBehavior;
+-(CGFloat) backingScaleFactor;
@end
@@ -186,9 +187,13 @@ -(NSImage*) uli_imageWithSnapshotForceActive: (BOOL)doForceActive
return nil;
}
+ CGFloat backingScaleFactor = 1.0;
+ if( [self respondsToSelector: @selector(backingScaleFactor)] )
+ backingScaleFactor = self.backingScaleFactor;
+
// Create a bitmap rep from the window and convert to NSImage...
NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: windowImage];
- NSImage *image = [[NSImage alloc] initWithSize: NSMakeSize(CGImageGetWidth(windowImage),CGImageGetHeight(windowImage))];
+ NSImage *image = [[NSImage alloc] initWithSize: NSMakeSize(CGImageGetWidth(windowImage) / backingScaleFactor, CGImageGetHeight(windowImage) / backingScaleFactor)];
[image addRepresentation: bitmapRep];
[bitmapRep release];
CGImageRelease(windowImage);
Please sign in to comment.
Something went wrong with that request. Please try again.