diff --git a/src/conio/bitmap_con.c b/src/conio/bitmap_con.c index 11e0181093a6ab37b02710e631ec566d15b812d6..7f9e9097348be007b2cc7f2830448f47deeb8c45 100644 --- a/src/conio/bitmap_con.c +++ b/src/conio/bitmap_con.c @@ -605,24 +605,18 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne struct vstat_vmem *vmem_ptr = get_vmem(&vstat); unsigned char lattr = vc->legacy_attr; - if (ypos > 1) { - for (y = 0; y < ypos; y++) { - if (top) { - bottom = true; - top = false; - } - else { - if (bottom) - bottom = false; - else { - if (y == ypos - 1) - break; - for (x = 0; x < vstat.cols; x++) { - if (vmem_ptr->vmem[y * vstat.cols + x].bg & 0x01000000) { - top = true; - break; - } - } + for (y = 0; y < ypos; y++) { + if (top) { + bottom = true; + top = false; + } + else { + if (bottom) + bottom = false; + for (x = 0; x < vstat.cols; x++) { + if (vmem_ptr->vmem[y * vstat.cols + x].bg & 0x01000000) { + top = true; + break; } } } diff --git a/src/conio/cterm.c b/src/conio/cterm.c index 8a6a7bd5524299949aa5e5da5e142c15650746c0..0c7fd8ac06305f3659abec4823fb7cf8f2a6a494 100644 --- a/src/conio/cterm.c +++ b/src/conio/cterm.c @@ -4956,7 +4956,7 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore unsigned char attr = cterm->attr; uint8_t prestel_last_mosaic = cterm->prestel_last_mosaic; bool fixed = false; - bool fixedheight = false; + bool dblheight = false; coord_conv_xy(cterm, CTERM_COORD_TERM, CTERM_COORD_SCREEN, &sy, &sx); ex = sx + TERM_MAXX - 1; @@ -4978,13 +4978,13 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore // Should be double-high line[i].bg |= 0x01000000; fixed = true; - fixedheight = true; + dblheight = true; } if (((cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT) == 0) && (line[i].bg & 0x01000000)) { // Should not be double-high line[i].bg &= ~0x01000000; fixed = true; - fixedheight = true; + dblheight = true; } if (line[i].fg != (cterm->fg_color | (ch << 24)) || line[i].bg != cterm->bg_color @@ -5014,6 +5014,8 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore prestel_last_mosaic = cterm->prestel_last_mosaic; } prestel_apply_ctrl_after(cterm, ch); + if (cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT) + dblheight = true; } else { // This is displayable @@ -5021,13 +5023,13 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore // Should be double-high line[i].bg |= 0x01000000; fixed = true; - fixedheight = true; + dblheight = true; } if (((cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT) == 0) && (line[i].bg & 0x01000000)) { // Should not be double-high line[i].bg &= ~0x01000000; fixed = true; - fixedheight = true; + dblheight = true; } if (line[i].fg != cterm->fg_color || line[i].bg != cterm->bg_color @@ -5085,7 +5087,7 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore if (force || fixed) vmem_puttext(sx, sy, ex, sy, line); free(line); - if (fixedheight) { + if (dblheight) { prestel_fix_line(cterm, x, y+1, false, true); } if (restore) {