Skip to content

Commit

Permalink
Tweak graphic status bar components to not have a vertical line at th…
Browse files Browse the repository at this point in the history
…eir leftmost point
  • Loading branch information
gnachman committed Jul 29, 2019
1 parent dd838f0 commit c314cd1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sources/iTermStatusBarGraphicComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,17 @@ - (NSBezierPath *)bezierPathWithValues:(NSArray<NSNumber *> *)values
const CGFloat y = iTermStatusBarSparklineBottomMargin + rect.origin.y + 0.5;
NSBezierPath *path = [[NSBezierPath alloc] init];
path.miterLimit = 1;
[path moveToPoint:NSMakePoint(x0, y)];
const double ceiling = MAX(1, self.ceiling);
int i = 0;
for (NSNumber *n in values) {
const CGFloat height = n.doubleValue * (rect.size.height - iTermStatusBarSparklineBottomMargin * 2) / ceiling;
const CGFloat x = x0 + i * barWidth;
[path lineToPoint:NSMakePoint(x, y + height)];
const NSPoint point = NSMakePoint(x, y + height);
if (i == 0) {
[path moveToPoint:point];
} else {
[path lineToPoint:point];
}
i++;
}
return path;
Expand Down

0 comments on commit c314cd1

Please sign in to comment.