Browse Source

Add showing of glyph underneath cursor

master
cancel 6 years ago
parent
commit
22c9cc85c7
  1. 4
      tui_main.c

4
tui_main.c

@ -168,7 +168,9 @@ void draw_tui_cursor(WINDOW* win, Glyph const* gbuffer, Usz field_h,
(void)ruler_x; (void)ruler_x;
if (cursor_y >= field_h || cursor_x >= field_w) if (cursor_y >= field_h || cursor_x >= field_w)
return; return;
chtype ch = (chtype)('@' | (A_reverse | A_bold | fg_bg(C_yellow, C_natural))); Glyph beneath = gbuffer[cursor_y * field_w + cursor_x];
char displayed = beneath == '.' ? '@' : beneath;
chtype ch = (chtype)(displayed | (A_reverse | A_bold | fg_bg(C_yellow, C_natural)));
wmove(win, (int)cursor_y, (int)cursor_x); wmove(win, (int)cursor_y, (int)cursor_x);
waddchnstr(win, &ch, 1); waddchnstr(win, &ch, 1);
} }

Loading…
Cancel
Save