mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 22:14:53 +02:00
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:
@@ -505,10 +505,10 @@ do_render(CTFontRef ct_font, bool bold, bool italic, hb_glyph_info_t *info, hb_g
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user