Skip to content

Commit 75c9970

Browse files
author
Ben Osheroff
committed
fixes for transparency + cgLayer code
1 parent 109b8c1 commit 75c9970

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/MacVim/MMCoreTextView.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,11 @@ - (void)drawRect:(NSRect)rect
607607
cgLayerSize.width,
608608
cgLayerSize.height);
609609

610-
CGContextDrawLayerInRect([context graphicsPort], drawRect, l);
610+
CGContextRef cgContext = [context graphicsPort];
611+
CGContextSaveGState(cgContext);
612+
CGContextSetBlendMode(cgContext, kCGBlendModeCopy);
613+
CGContextDrawLayerInRect(cgContext, drawRect, l);
614+
CGContextRestoreGState(cgContext);
611615
}
612616
}
613617

@@ -1487,6 +1491,7 @@ - (void)scrollRect:(NSRect)rect lineCount:(int)count
14871491
// draw self on top of self, offset so as to "scroll" lines vertically
14881492
CGContextSaveGState(context);
14891493
CGContextClipToRect(context, clipRect);
1494+
CGContextSetBlendMode(context, kCGBlendModeCopy);
14901495
CGContextDrawLayerAtPoint(
14911496
context, CGPointMake(0, -yOffset), [self getCGLayer]);
14921497
CGContextRestoreGState(context);

0 commit comments

Comments
 (0)