mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Fix tab dragging crashing under 10.14 due to deprecated API
Use the newer `cacheDisplayInRect:toBitmapImageRep:` API instead to work around this.
This commit is contained in:
@@ -338,7 +338,10 @@
|
||||
if(([self state] == NSOnState) && ([[_controlView styleName] isEqualToString:@"Metal"]))
|
||||
cellFrame.size.width += 1.0;
|
||||
[_controlView lockFocus];
|
||||
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:cellFrame] autorelease];
|
||||
|
||||
NSBitmapImageRep *rep = [[self controlView] bitmapImageRepForCachingDisplayInRect:cellFrame];
|
||||
[[self controlView] cacheDisplayInRect:cellFrame toBitmapImageRep:rep];
|
||||
|
||||
[_controlView unlockFocus];
|
||||
NSImage *image = [[[NSImage alloc] initWithSize:[rep size]] autorelease];
|
||||
[image addRepresentation:rep];
|
||||
|
||||
Reference in New Issue
Block a user