Skip to content

Commit

Permalink
tweak diagonal box characters for uniform appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Nov 14, 2024
1 parent 5e9a828 commit dc025ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wintext.c
Original file line number Diff line number Diff line change
Expand Up @@ -4143,6 +4143,7 @@ skip_drawing:;
#ifdef use_extpen
LOGBRUSH brush = (LOGBRUSH){BS_SOLID, fg, 0};
DWORD style = PS_GEOMETRIC | PS_SOLID;
HPEN roundpen = ExtCreatePen(style, penwidth, &brush, 0, 0);
if (boxpower)
style |= PS_ENDCAP_SQUARE; // skipped for DEC Technical sum segments
HPEN pen = ExtCreatePen(style, penwidth, &brush, 0, 0);
Expand Down Expand Up @@ -4233,6 +4234,8 @@ skip_drawing:;
// penwidth / 3 on the right/bottom side is a compromise
y2 -= max(penwidth / 3, 1);
x2 -= max(penwidth / 3, 1);
// also the square pen appears wrong with the diagonals
SelectObject(dc, roundpen);
}

// draw the line back again to compensate for the missing endpoint
Expand All @@ -4243,7 +4246,7 @@ skip_drawing:;
if (y3 > -3) // skip for dashed line segments
LineTo(dc, x1, y1);

if (heavy)
if (heavy || y3 == -2)
SelectObject(dc, pen);
}
}
Expand Down Expand Up @@ -4416,6 +4419,7 @@ skip_drawing:;
// remove Box Drawing resources
SelectObject(dc, oldpen);
DeleteObject(pen);
DeleteObject(roundpen);
DeleteObject(heavypen);
DeleteObject(br);
}
Expand Down
1 change: 1 addition & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Character rendering
* Fix skipping of accent to next position on background colour.
* Fix drawing of Powerline round symbols (mintty/wsltty#358).
* Fix rendering of right-to-left scripts on italic or cursor position.
* Tweak diagonal box characters for uniform appearance.

Window handling
* Show new tab at its target position right away (#1292).
Expand Down

0 comments on commit dc025ed

Please sign in to comment.