macOS: Fix incorrect horizontal positioning of some full-width East Asian characters

Fixes #1457
Also render multi-cell PUA characters centered, matching behavior on other platforms
This commit is contained in:
Kovid Goyal 2020-04-09 13:24:55 +05:30
parent 1f1b52b580
commit 859033415b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 4 deletions

View File

@ -25,6 +25,12 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Fix specifying options for layouts in the startup session file not working
(:iss:`2520`)
- macOS: Fix incorrect horizontal positioning of some full-width East Asian characters
(:iss:`1457`)
- macOS: Render multi-cell PUA characters centered, matching behavior on other
platforms
0.17.2 [2020-03-29]
--------------------

View File

@ -505,10 +505,10 @@
Region src = {.bottom=cell_height, .right=canvas_width}, dest = {.bottom=cell_height, .right=canvas_width};
render_alpha_mask(render_buf, canvas, &src, &dest, canvas_width, canvas_width);
}
if (num_cells > 1) {
// center glyphs
CGFloat delta = canvas_width - br.size.width;
if (delta > 1) right_shift_canvas(canvas, canvas_width, cell_height, (unsigned)(delta / 2.f));
if (num_cells && (center_glyph || (num_cells == 2 && *was_colored))) {
// center glyphs (two cell emoji and PUA glyphs)
CGFloat delta = (((CGFloat)canvas_width - br.size.width) / 2.f) - br.origin.x;
if (delta >= 1.f) right_shift_canvas(canvas, canvas_width, cell_height, (unsigned)(delta));
}
return true;
}