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

Don't draw any lines above the visible range. Their descenders can hang down...

Don't draw any lines above the visible range. Their descenders can hang down into the display when vertical spacing is less than 100%. Issue 6223
parent ef97b181
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -217,11 +217,13 @@ typedef struct iTermTextColorContext {
NSInteger yLimit = _numberOfLines;
 
VT100GridCoordRange boundingCoordRange = [self coordRangeForRect:rect];
NSRange visibleLines = [self rangeOfVisibleRows];
// Start at 0 because ligatures can draw incorrectly otherwise. When a font has a ligature for
// -> and >-, then a line like ->->-> needs to start at the beginning since drawing only a
// suffix of it could draw a >- ligature at the start of the range being drawn. Issue 5030.
boundingCoordRange.start.x = 0;
boundingCoordRange.start.y = MAX(0, boundingCoordRange.start.y - 1);
boundingCoordRange.start.y = MAX(MAX(0, boundingCoordRange.start.y - 1), visibleLines.location);
boundingCoordRange.end.x = MIN(_gridSize.width, boundingCoordRange.end.x + haloWidth);
boundingCoordRange.end.y = MIN(yLimit, boundingCoordRange.end.y + 1);
Loading
Loading
@@ -252,7 +254,10 @@ typedef struct iTermTextColorContext {
}
}
 
[self drawRanges:ranges count:numRowsInRect origin:boundingCoordRange.start boundingRect:[self rectForCoordRange:boundingCoordRange]];
[self drawRanges:ranges count:numRowsInRect
origin:boundingCoordRange.start
boundingRect:[self rectForCoordRange:boundingCoordRange]
visibleLines:visibleLines];
if (_showDropTargets) {
[self drawDropTargets];
Loading
Loading
@@ -296,7 +301,11 @@ typedef struct iTermTextColorContext {
return count;
}
 
- (void)drawRanges:(NSRange *)ranges count:(NSInteger)numRanges origin:(VT100GridCoord)origin boundingRect:(NSRect)boundingRect {
- (void)drawRanges:(NSRange *)ranges
count:(NSInteger)numRanges
origin:(VT100GridCoord)origin
boundingRect:(NSRect)boundingRect
visibleLines:(NSRange)visibleLines {
// Configure graphics
[[NSGraphicsContext currentContext] setCompositingOperation:NSCompositeCopy];
 
Loading
Loading
@@ -304,7 +313,6 @@ typedef struct iTermTextColorContext {
_blinkingFound = NO;
 
NSMutableArray<iTermBackgroundColorRunsInLine *> *backgroundRunArrays = [NSMutableArray array];
NSRange visibleLines = [self rangeOfVisibleRows];
 
for (NSInteger i = 0; i < numRanges; i++) {
const int line = origin.y + i;
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