Skip to content

Commit

Permalink
Prevent bar cursor overwriting next glyph (bug#16856)
Browse files Browse the repository at this point in the history
* src/nsterm.m (ns_draw_window_cursor): Test glyph width vs cursor width
before setting final size.
  • Loading branch information
alanthird committed Jul 19, 2016
1 parent a80ee12 commit bf5ddde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nsterm.m
Expand Up @@ -2861,7 +2861,10 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
{
if (cursor_width < 1)
cursor_width = max (FRAME_CURSOR_WIDTH (f), 1);
w->phys_cursor_width = cursor_width;

/* The bar cursor should never be wider than the glyph. */
if (cursor_width < w->phys_cursor_width)
w->phys_cursor_width = cursor_width;
}
/* If we have an HBAR, "cursor_width" MAY specify height. */
else if (cursor_type == HBAR_CURSOR)
Expand Down

0 comments on commit bf5ddde

Please sign in to comment.