Another place to use NUM_UNDERLINE_STYLES
This commit is contained in:
parent
6b47f6f769
commit
f9b35c71d7
@ -400,10 +400,13 @@ def prerender_function(
|
|||||||
render_cursor, cursor_beam_thickness=cursor_beam_thickness,
|
render_cursor, cursor_beam_thickness=cursor_beam_thickness,
|
||||||
cursor_underline_thickness=cursor_underline_thickness, cell_width=cell_width,
|
cursor_underline_thickness=cursor_underline_thickness, cell_width=cell_width,
|
||||||
cell_height=cell_height, dpi_x=dpi_x, dpi_y=dpi_y)
|
cell_height=cell_height, dpi_x=dpi_x, dpi_y=dpi_y)
|
||||||
cells = list(map(f, range(1, NUM_UNDERLINE_STYLES + 1)))
|
# If you change the mapping of these cells you will need to change
|
||||||
cells.append(f(0, strikethrough=True))
|
# NUM_UNDERLINE_STYLES and BEAM_IDX in shader.c and STRIKE_SPRITE_INDEX in
|
||||||
cells.append(f(missing=True))
|
# window.py and MISSING_GLYPH in font.c
|
||||||
cells.extend((c(1), c(2), c(3)))
|
cells = list(map(f, range(1, NUM_UNDERLINE_STYLES + 1))) # underline sprites
|
||||||
|
cells.append(f(0, strikethrough=True)) # strikethrough sprite
|
||||||
|
cells.append(f(missing=True)) # missing glyph
|
||||||
|
cells.extend((c(1), c(2), c(3))) # cursor glyphs
|
||||||
tcells = tuple(cells)
|
tcells = tuple(cells)
|
||||||
return tuple(map(ctypes.addressof, tcells)), tcells
|
return tuple(map(ctypes.addressof, tcells)), tcells
|
||||||
|
|
||||||
|
|||||||
@ -314,7 +314,7 @@ cell_update_uniform_block(ssize_t vao_idx, Screen *screen, int uniform_buffer, c
|
|||||||
}
|
}
|
||||||
rd->use_cell_for_selection_bg = IS_SPECIAL_COLOR(highlight_bg) ? 1. : 0.;
|
rd->use_cell_for_selection_bg = IS_SPECIAL_COLOR(highlight_bg) ? 1. : 0.;
|
||||||
// Cursor position
|
// Cursor position
|
||||||
enum { BLOCK_IDX = 0, BEAM_IDX = 8, UNDERLINE_IDX = 9, UNFOCUSED_IDX = 10 };
|
enum { BLOCK_IDX = 0, BEAM_IDX = NUM_UNDERLINE_STYLES + 3, UNDERLINE_IDX = NUM_UNDERLINE_STYLES + 4, UNFOCUSED_IDX = NUM_UNDERLINE_STYLES + 5 };
|
||||||
if (cursor->is_visible) {
|
if (cursor->is_visible) {
|
||||||
rd->cursor_x = screen->cursor->x, rd->cursor_y = screen->cursor->y;
|
rd->cursor_x = screen->cursor->x, rd->cursor_y = screen->cursor->y;
|
||||||
if (cursor->is_focused) {
|
if (cursor->is_focused) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user