Don’t show “pop-out” animation for empty rects

Fixes #833.
This commit is contained in:
Allan Odgaard
2013-03-26 17:54:50 +01:00
parent 4937b51d02
commit d54bf55dc0

View File

@@ -26,6 +26,9 @@ static double const kFadeDuration = 0.60;
void OakShowPopOutAnimation (NSRect aRect, NSImage* anImage)
{
if(aRect.size.width == 0 || aRect.size.height == 0)
return;
aRect = NSInsetRect(aRect, -kExtendWidth, -kExtendHeight);
NSRect contentRect = NSMakeRect(0, 0, NSWidth(aRect), NSHeight(aRect));
NSWindow* window = [[NSWindow alloc] initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];