#include <err.h>
+#include <math.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
draw_lines(state_t *st, screen_t *sc, int low, int high)
{
uint32_t *scanptr1, *scanptr2, *scanptr1_next;
- int row;
+ int row, srow, urow;
color = st->monocolor;
+ /* Row to underline or strike if the attribute is enabled */
+ srow = (int)ceil(((double)FONT_HEIGHT) / 2.0);
+ urow = (FONT_HEIGHT - 1) + (cfg_leading > 0 ? 1 : 0);
+
if (high < low || low < 0 || high >= cfg_text_height) {
/* Invalid */
sc->update_x = sc->update_y = sc->update_w = sc->update_h = 0;
/* Process mode phase 2 */
if ((m & TMODE_INVISIBLE) != 0)
p = 0;
- if (grow == 8 && (m & (TMODE_UNDERLINE | TMODE_DUNDERLINE)) != 0) {
+ if (grow == urow && (m & (TMODE_UNDERLINE | TMODE_DUNDERLINE)) != 0) {
p = 1;
level = olevel = INTENSITY_DIM / 2;
if ((m & TMODE_DUNDERLINE) != 0)
level = olevel = INTENSITY_NORMAL;
- } else if (grow == 5 && (m & TMODE_STRIKE) != 0)
+ } else if (grow == srow && (m & TMODE_STRIKE) != 0)
p = 1;
if (iblink) {
if (!p)
}
/* Inverse for XOR cursor */
- if (cursor_xor == col && grow < FONT_HEIGHT &&
+ if (cursor_xor == col && grow <= urow &&
((st->cursor_mode == CMODE_BLOCK) ||
(st->cursor_mode == CMODE_LINE &&
grow >= (FONT_HEIGHT - 2)) ||