Fixed blurred unfiltered screenshots

This commit is contained in:
Lior Halphon 2021-12-26 18:38:08 +02:00
parent 66f7babe86
commit 6e7ba7589c
1 changed files with 6 additions and 6 deletions

View File

@ -2210,6 +2210,12 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
NSImage *ret = nil;
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GBFilterScreenshots"]) {
ret = [_view renderToImage];
[ret lockFocus];
NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0, 0,
ret.size.width, ret.size.height)];
[ret unlockFocus];
ret = [[NSImage alloc] initWithSize:ret.size];
[ret addRepresentation:bitmapRep];
}
if (!ret) {
ret = [Document imageFromData:[NSData dataWithBytesNoCopy:_view.currentBuffer
@ -2219,12 +2225,6 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
height:GB_get_screen_height(&gb)
scale:1.0];
}
[ret lockFocus];
NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0, 0,
ret.size.width, ret.size.height)];
[ret unlockFocus];
ret = [[NSImage alloc] initWithSize:ret.size];
[ret addRepresentation:bitmapRep];
return ret;
}