Skip to content
Snippets Groups Projects
Commit 4bde161c authored by George Nachman's avatar George Nachman
Browse files

Mask two cells for double width characters being drawn over a box cursor.

Issue 5884
parent c3d2d432
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -19,6 +19,7 @@ typedef struct {
- (iTermCursorNeighbors)cursorNeighbors;
 
- (void)cursorDrawCharacterAt:(VT100GridCoord)coord
doubleWidth:(BOOL)doubleWidth
overrideColor:(NSColor*)overrideColor
context:(CGContextRef)ctx
backgroundColor:(NSColor *)backgroundColor;
Loading
Loading
Loading
Loading
@@ -193,12 +193,14 @@
CGContextRef ctx = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
if (smart && focused) {
[self drawSmartCursorCharacter:screenChar
doubleWidth:doubleWidth
backgroundColor:backgroundColor
ctx:ctx
coord:coord];
} else {
// Non-smart
[self.delegate cursorDrawCharacterAt:coord
doubleWidth:doubleWidth
overrideColor:foregroundColor
context:ctx
backgroundColor:backgroundColor];
Loading
Loading
@@ -207,6 +209,7 @@
}
 
- (void)drawSmartCursorCharacter:(screen_char_t)screenChar
doubleWidth:(BOOL)doubleWidth
backgroundColor:(NSColor *)backgroundColor
ctx:(CGContextRef)ctx
coord:(VT100GridCoord)coord {
Loading
Loading
@@ -218,6 +221,7 @@
backgroundColor:backgroundColor];
 
[self.delegate cursorDrawCharacterAt:coord
doubleWidth:doubleWidth
overrideColor:overrideColor
context:ctx
backgroundColor:nil];
Loading
Loading
Loading
Loading
@@ -2702,6 +2702,7 @@ static BOOL iTermTextDrawingHelperIsCharacterDrawable(screen_char_t *c,
}
 
- (void)cursorDrawCharacterAt:(VT100GridCoord)coord
doubleWidth:(BOOL)doubleWidth
overrideColor:(NSColor *)overrideColor
context:(CGContextRef)ctx
backgroundColor:(NSColor *)backgroundColor {
Loading
Loading
@@ -2709,7 +2710,8 @@ static BOOL iTermTextDrawingHelperIsCharacterDrawable(screen_char_t *c,
[context saveGraphicsState];
 
int row = coord.y + _numberOfScrollbackLines;
VT100GridCoordRange coordRange = VT100GridCoordRangeMake(coord.x, row, coord.x + 1, row + 1);
int width = doubleWidth ? 2 : 1;
VT100GridCoordRange coordRange = VT100GridCoordRangeMake(coord.x, row, coord.x + width, row + 1);
NSRect innerRect = [self rectForCoordRange:coordRange];
NSRectClip(innerRect);
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment